Jump to content

Recommended Posts

Posted

Good day!

I need to have $page->created as a UNIX timestamp (UTC)  to compare it to time(). But I can't figure it out how to do it. I get the $page->created time in the future, later than time(). Please help!

Posted (edited)

I am really confused here. Please be so kind to explain. When I get $page->created as a timestamp, should not it be the same as 11 digits not depending on any timezone?

But when I create a new page and straight after that do something like this:
 

echo time();
echo $pages->get(1053)->created;

The first number is less than the second in an amount of seconds equal to an hour. I assume both of these numbers are UNIX timestamps and should be about the same, but they differ in an hour.

Edited by Ivan Gretsky
Posted

It should in theory, but I had issues where the mismatch came from mysql using another timezone than php, because created is "created" by sql NOW() and not in php afaik.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...