![]() ![]() #Javascript date constructor isoThe ISO format is an international standard to represent date and time. For example, if we are in Israel and the time zone is UTC+2 (or UTC+3 in the summer), so the computer just add 7200000 (1000ms*60s*60m*2h) to the system clock and shows us the time by our time zone.īefore we finally jump to the Date constructor the last thing I wanna talk about is - ISO 8601 date and time format. To show us the time in our correct time zone, the computer just adds hours by our time zone to the system clock. The computer knows and counts the time only in UTC. When the computer knows the time that passes since this date, he can calculate this number and extract our time in an understandable format. In most of the computers over the world, there is a system clock that counts the number of milliseconds that pass since 00:00:00 in UTC. ![]() So here I’m, trying to make things a little bit clearer. Yeah, we all know the Time Zone but we don’t really understand how it works on computers, and when we don’t understand that, we can easily get lost when we have to manipulate dates and times. One of the things that get programmers confused it’s the Time Zone. The second thing is a post that was published on the JavaScript Israel community Group on Facebook. My friend was OK with the Native API but because the Back-End developer uses Moment on the server, he preferred that my friend will use it on the client-side too. The first thing is, that a friend of mine that works as a Front-End Developer has been told by his Back-End coworker to use Moment.js. Two things made me want to write this article. As long as I got dipper, I realize how it is so simple, and yet, programmers get lost even in small tasks. I had to do a lot of calculations of difference between minutes and hours and I started to get dipper to the Date constructor in JavaScript and to the system time in general. ![]() In the last few months, I have been working on a huge project that a lot of it uses dates and times. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |