![]() Sometimes we need more precise time measurements. Note that unlike many other systems, timestamps in JavaScript are in milliseconds, not in seconds. Use Date.now() to get the current timestamp fast.That’s because a Date becomes the timestamp when converted to a number. Dates can be subtracted, giving their difference in milliseconds.Good for adding/subtracting days/months/hours. Date auto-corrects itself when out-of-range components are set.Days of week in getDay() are also counted from zero (that’s Sunday).Months are counted from zero (yes, January is a zero month). ![]() We can’t create “only date” or “only time”: Date objects always carry both.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |