From where javascript fetches date

From where javascript fetches date  #angularjs #reactjs

  • The Date function in the browser just uses the system clock.
  • The problem is that afaik, if you are a Windows user then, your PC’s date will be fetched through a worldclock server, somewhere, it’s pbly Microsoft’s BUT if you’re running Linux, then your date/time are being computed on your computer.
  • Stack Overflow works best with JavaScript enabled
  • The system clock may be set manually, via an NTP server, via GPS or mobile phone signal.
  • I’m working on a small web app which has a server and clients.

I know that there’re lots of topics on how js’s date() works but I miss one bit. I’m working on a small web app which has a server and clients. Each client may run on Windows or Linux (mac… etc.). The problem is that afaik, if you are a Windows user then, your PC’s date will be fetched through a worldclock server, somewhere, it’s pbly Microsoft’s BUT if you’re running Linux, then your date/time are being computed on your computer.
So, does js’s date() fetch a date (or time) requesting to a server, just like windows does, or it just looks at a given pc’s date, reads it and displays it?
To me this is of great importance as I’ve a dual-bootable computer and every switch from linux to windows causes time inaccuracy, meaning that I’ve to take into account clients’ wrong date/time if JavaScript reads it from one’s pc. Put in other words, does JS’s date() fetch the date and time information requesting separate server by giving it location information for the user based on say, IP?

@ng_real_ninja: From where javascript fetches date #angularjs #reactjs

I know that there’re lots of topics on how js’s date() works but I miss one bit. I’m working on a small web app which has a server and clients. Each client may run on Windows or Linux (mac… etc.). The problem is that afaik, if you are a Windows user then, your PC’s date will be fetched through a worldclock server, somewhere, it’s pbly Microsoft’s BUT if you’re running Linux, then your date/time are being computed on your computer. So, does js’s date() fetch a date (or time) requesting to a server, just like windows does, or it just looks at a given pc’s date, reads it and displays it? To me this is of great importance as I’ve a dual-bootable computer and every switch from linux to windows causes time inaccuracy, meaning that I’ve to take into account clients’ wrong date/time if JavaScript reads it from one’s pc. Put in other words, does JS’s date() fetch the date and time information requesting separate server by giving it location information for the user based on say, IP?

function in the browser just uses the system clock. This is true regardless of operating system.

The system clock may be set manually, via an NTP server, via GPS or mobile phone signal. This is true regardless of operating system.

This is likely caused by the time zone being incorrectly configured on one or both of your operating system configurations. There is no realistic way to account for that sort of misconfiguration when writing software.

No, it’s not caused by time zone. There are lots of articles about this phenomenon, such as this one. You either need to switch Linux to set bios with local time (which varies per distro), or set Windows to set the bios with UTC via the unsupported

From where javascript fetches date

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.