Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Negative timestamp -- does it makes sense in PHP? [closed]

According to the manual, PHP uses the Unix Epoch (00:00:00 UTC on 1 January 1970) to generate its timestamps.

Given this definition, I believe that it is reasonable to work with negative timestamps, when the target date is before the Unix Epoch. But, since time is a complicated matter in programming, I want to know if there is any caveat in using negative timestamps in PHP.

like image 533
Metalcoder Avatar asked Oct 04 '12 18:10

Metalcoder


1 Answers

Indeed, you're absolutely right. Negative numbers is just the amount of seconds before the Unix Epoch.

like image 54
GolezTrol Avatar answered Sep 23 '22 00:09

GolezTrol