The number of milliseconds since the era of January 1, 1970 00:00:00 UTC is the same everywhere. It doesnβt matter if you are currently in Los Angeles or Kiritimati.
EDIT
The toMillis method returns the number of milliseconds since an era. The era of January 1, 1970 00:00:00 UTC.
Think of it this way. If person A was born in Los Angeles in the era, and person B was born in Kiritimati in the era, then the age of person A would be time1.toMillis() , and the current age of person B would be time2.toMillis() , right?
Although the UTC time zone was midnight when they were born, it was not midnight in their respective time clock. You can find out by their time zones: UTC-8 and UTC + 14.
Now, if time1.toMillis() != time2.toMillis() this will mean that one of the two people is older. This would mean that he lived more than a millisecond in his life. Of course, this is not so, because, as we said, they were born at the same time. Therefore, the conclusion that you see is correct , and I do not think that you should try to change it.
source share