Hi there

I just need some clarification on how time is seen in PHP

1000 would equal 1 sec ?
and therefore 60 000 would equal 1 minute right ?
and 1 hour would be 3 600 000 ?

I somehow think I'm wrong.

9 Years
Discussion Span
Last Post by Venom Rush

Ok, so then 1 minute would be written as 60 and 1 hour as 3600 and 1 day as 86400?


Ok, so then 1 minute would be written as 60 and 1 hour as 3600 and 1 day as 86400?

PHP can measure time in seconds using the time() function.

or you can use microtime() which is a measure of time in microseconds.

The PHP timestamp is a measure of the number of seconds (or microseconds with microtime) that have elapsed since the Unix Epoch (January 1 1970 00:00:00 GMT). So if you want to work with dates before the Epoch you will have to cater for that in your code. It also cannot measure dates in the future that require more bits then allocated for its datatype - not sure what that date is exactly.

Therefore, normally the PHP time functions are used to get the current date, and make calculations. But if you want to save the resulting date, its better to save it as an actual date if its range may lie outside the limitation of the PHP timestamp.


Thanks for the response. I had a look at the manual under time but it didn't make it quite clear.

Thanks once again ;)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.