Mat
Mat

Reputation: 603

Checking the format of the timestamp

I have a timestamp string with me (1606031551). There are n number of functions to convert a timestamp into UTC in php. But I could not find a method that checks whether the timestamp string is UTC in php. Can you please tell if there are any methods which determine whether the current timestamp string is UTC?

Upvotes: 0

Views: 53

Answers (2)

onesvat
onesvat

Reputation: 176

Timestamps are simple integer that counts every second from Thursday, 1 January 1970. Unix timestamps are in UTC timezone. You cannot extract timezone from a simple integer number without any other information.

Upvotes: 3

Diabl0
Diabl0

Reputation: 166

Timestamp should always be in UTC because it's pure int and you cannot pass timezone with it.

Upvotes: -1

Related Questions