Date — Time

Dart DateTime — EcmaScript Date

Different Offsets

Which One?

XKCD. https://xkcd.com/1883/. Licensed under a Creative Commons Attribution-NonCommercial 2.5 License.
TZ=America/Los_Angeles dart dt.dart
2017–03–12 03:00:00.000
2017–03–12 03:00:00.000
$ TZ=Brazil/East dart brazil.dart 
15
1
$ TZ=Brazil/East dart-1.24 brazil.dart
14
23
$ TZ=Europe/Paris dart /tmp/invalid.dart
dt1 is after dt2?: true
$ TZ=Europe/Paris ./a.out 
The two date-times are not the same.

Changing

Non DST Changes

Samoa and Tokelau

Alignments

Timezones

  • Some timezones include a half-hour offset compared to UTC. India, for example, is at UTC +5:30. At least one timezone, Chatham Islands, even uses 45 minutes: UTC +12:45 / +13:45.
  • Short names for timezones are not unique. For instance “IST” can stand for “Indian Standard Time” (UTC +5:30), “Irish Standard Time” (UTC +1:00), or “Israel Standard Time” (UTC +2:00).
The world in regions (except Antarctica) where local clocks have all been the same since 1970.

Stdlib

Equivalent Years

d8> new Date(1570, 07, 10)
Mon Aug 10 1570 00:00:00 GMT+0200 (CEST)
TZ=Europe/London js
js> new Date(1970, 0, 1, 0, 0, 1).toString()
“Thu Jan 01 1970 01:00:01 GMT+0100 (BST)”
$ TZ=America/Santo_Domingo v8
V8 version 6.2.0 (candidate)
d8> new Date(1969, 11, 31, 20, 0, 1)
Wed Dec 31 1969 21:00:01 GMT-0300 (-0430)
$ TZ=Australia/Canberra dart canberra.dart
1901–12–14 06:45:53.000
1901–12–14 07:45:52.999

Recommendations

  • Europe/Paris
  • Antarctica/Troll
  • Egypt
  • Australia/Canberra
  • Australia/Lord_Howe
  • America/Los_Angeles
  • Asia/Calcutta
  • Brazil/East

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

My Java development Intern Experience

How do you implement Blue/Green deployment in AWS (Part 7/7)

7 Reasons Why Facebook’s React Native Wins Over Google’s Flutter

Lab 2 — Digital I/O

What is HTML? With Complete Information!

What is HTML? How is HTML used? What is the tag of HTML? You will find answers to all these questions in this article.

Unity camera shake

Handle AtomicPay’s webhook with Microsoft Azure (Part 2/3) — invoice verification with Azure…

How to bring Quantum Programming for everyone ?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Florian Loitsch

Florian Loitsch

More from Medium

Setup Android Avd Emulator Without Android Studio in Linux

Dependency Injection | Much Easier now… :)

Guide to JNI (Java Native Interface)

Ransom note challenge in Kotlin