Using now() in different time zones (or with daylight saving time)
Mostra commenti meno recenti
If two people in two different time zones simultaneously used the now() function, would they get different answers? Also, does the now() result depend on whether daylight saving time is in use?
I understand now() returns the number of days since 0 Jan 0000, but does that mean "0 Jan 0000 UTC", or "0 Jan 0000 in the local time zone"?
Many thanks,
Neil
2 Commenti
Stephen23
il 6 Dic 2019
in the local time zone (i.e. the one the computer is set to).
Neil Rogers
il 6 Dic 2019
Risposta accettata
Più risposte (1)
Jeremy
il 6 Dic 2019
now
Limitations
- MATLAB Online returns the current date and time in Coordinated Universal Time (UTC) rather than local time.
1 Commento
Jeremy
il 6 Dic 2019
Additionally, you can use the syntax
[c tf] = clock
Where tf will be a logical that is 1 (true) if the current local date and time occur during Daylight Saving Time in your current time zone, and 0 (false) otherwise.
Categorie
Scopri di più su Dates and Time in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!