date() function
Moderator: General Moderators
date() function
hi, i am having a problem with the date() as well as getdate().
the unix timestamp is 1117583940, which should be converted to 31 may 2005.
but i use both date() and getdate() and they give me 1 june 2005.
someone helps? thanks.
the unix timestamp is 1117583940, which should be converted to 31 may 2005.
but i use both date() and getdate() and they give me 1 june 2005.
someone helps? thanks.
Well, if when you echo $date and $row['date'] right after that, you get 1117583940 and 1 june 2005 respectively, I have no idea. Maybe try putting the time of day in $date as well to see exactly how much its off.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
i tried and get wed 01 jun 2005 07:59:00 +0800
Code: Select all
date("e;r"e;, $rowї'date'])Could it be timezone problems? Like I said, I'm getting 5:59 PM, in MST which is -0700 right now. With the time difference, that would pop it ahead a day. I'm not really sure how to apply this info to solve your problem, but it's the only thing I can think of that might be doing it.
Is the time on your server right?
Is the time on your server right?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
If you're running your own Linux server, look into the rdate shell command. That will sync your server's time with another server.
If you've set phpBB's time to GMT and you're not in that timezone, that might explain why the times are off. If you set it to where you actually are, the date might make more sense.
If you've set phpBB's time to GMT and you're not in that timezone, that might explain why the times are off. If you set it to where you actually are, the date might make more sense.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.