Jump to content

Time Issues


mrdhood

Recommended Posts

Hey I'm having issues with using strtotime(), date(), and time().

 

I have a couple problems.

The first is: I used strtotime to get the unix of a specific date and time (worked great, even outputted the correct time using date() to return it). However when I went to post information on it (I set it up so that you can't post after the event started), it told me it already started like an hour before it was supposed to. I used

if (time() > $event['when']) { echo "too late."; } else { do it }

to determine.

 

That had me very confused.

 

Then I decided instead of manually inputting the event times I would pull them from an xml file, which I had no trouble reading.

 

I used:

 strtotime("Next $day, $time PM")

with $day = Sun, $time = 1:00- This outputted a unix timestamp but then date() returned it as being 7 pm on sunday instead.

 

Any ideas what would be causing these strange things?

Link to comment
https://forums.phpfreaks.com/topic/251700-time-issues/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.