Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Time.to_i always return number of seconds since EPOCH in UTC?

Is the timezone difference always ignored, regardless in which zone the time is expressed in?

Intuitively, the number of seconds passed since EPOCH should be higher for those who are, for example, in UTC+2. However, this seems not to be the case.

like image 907
randomguy Avatar asked Sep 22 '10 12:09

randomguy


1 Answers

Epoch is based on the utc timezone https://en.wikipedia.org/wiki/Unix_time it does not depend of the timezone you're currently in.

like image 154
hellvinz Avatar answered Oct 03 '22 11:10

hellvinz