Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UNIX timestamp always in GMT?

UNIX timestamp always in GMT?

I tried to run php function time()

and when I tried to convert the unix timestamp from the time() function, the output is not similar to the computer time.

Thank You

like image 266
bbnn Avatar asked May 18 '10 01:05

bbnn


People also ask

Is UNIX timestamp same for all timezones?

The UNIX timestamp is the number of seconds (or milliseconds) elapsed since an absolute point in time, midnight of Jan 1 1970 in UTC time. (UTC is Greenwich Mean Time without Daylight Savings time adjustments.) Regardless of your time zone, the UNIX timestamp represents a moment that is the same everywhere.

Is UNIX timestamp dependent on timezone?

Notice that UNIX Epoch is UTC so it identifies without errors a specific moment in time. Never ask about the timezone of a UNIX epoch timestamp, it is UTC by definition.

Is epoch time always in UTC?

In a computing context, an epoch is the date and time relative to which a computer's clock and timestamp values are determined. The epoch traditionally corresponds to 0 hours, 0 minutes, and 0 seconds (00:00:00) Coordinated Universal Time (UTC) on a specific date, which varies from system to system.

Is Unix epoch time in UTC?

The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z).


2 Answers

yep, UNIX timestamp represents how much seconds past from unix-time epoch in GMT+0

like image 69
zerkms Avatar answered Oct 14 '22 23:10

zerkms


Technically, no.

Even though epoch time is the means elapsed seconds since 1/1/70 00:00:00 the real "GMT" (UTC) is not.

UTC time needed to be changed a few times to take in to account the slowing speed of the rotating earth.

As everybody wrote, most people use epoch at UTC.

You can read more in https://en.wikipedia.org/wiki/Unix_time.

like image 25
yonatanh Avatar answered Oct 14 '22 22:10

yonatanh