randomguy randomguy - 1 year ago 75
Ruby Question

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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download