In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to use javascript to calculate the number of days since birth". Interested friends might as well take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use javascript to calculate how many days it has been since you were born.
How javascript calculates how many days you live: first define your birthday; then use the "parseInt ((today.getTime ()-birthday.getTime ()) / (1000 days 3600 days 24);" method to calculate how many days you live.
This article operating environment: windows7 system, javascript1.8.5 version, DELL G3 computer
Javascript's method of figuring out how many days he lived
Calculate how many days you lived from birth to today, and how old you are this year.
The code is as follows:
Var birthday=new Date ("1996-06-21"); / / define your birthday var today=new Date (); / / getTime () returns the number of milliseconds since January 1, 1970. / / 1 second = 1000 milliseconds 3600 hours 1 hour * 1 minute 24 hours var time=parseInt ((today.getTime ()-birthday.getTime ()) / (1000 seconds 3600 seconds 24)); var year=Math.round (time/365); / / round () method can round a number to the nearest integer. [xss_clean] ("live from birth to today" + time+ "days"); [xss_clean] ("this year" + year+ "year"). At this point, I believe you have a deeper understanding of "how to use javascript to calculate how many days you have been born to now". You might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.