|
| Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more. |
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Posts: n/a
|
Dates Suddenly Changed?
I noticed today that the dates for posts on my site are suddenly incorrect (It's a blog). I have always used a date with the NOW() function of mySQL and stored the dates of each post in my database. So, the first thing I did was check to see if the database data had changed for some reason... the dates are correct in the database.
I have not changed any of my code in a long time (so it should be unrelated), so I am curious to see if there was an upgrade to mySQL or PHP that has changed the way things are processed. Here is a code sample to show how I process the date after I run the mySQL query: $date = $row['date']; $date = convert_date($date); $date = date("<b>F j, Y \A.\D.<\/b> \a\\t <b>g:i A E\S\T<\/b>", $date); print($date); function convert_date( $date ) { $year = substr($date, 0, 4); $month = substr($date, 4, 2); $day = substr($date, 6, 2); $hour = substr($date, 8, 2); if ($hour <= 21) { $hour = $hour + 3; } else { $hour = $hour - 20; } $minute = substr($date, 10, 2); $seconds = substr($date, 12, 2); $timestamp = mktime($hour, $minute, $seconds, $month, $day, $year); return $timestamp; } Thanks in advance! |
|
|
#2 |
|
Join Date: Dec 2002
Location: TX
Posts: 12,381
Reputation: 248
|
Check the sticky : http://forum.powweb.com/showthread.php?t=45454
It seems MySQL 4.1 made some changes to timestamps.
__________________
Thank you to all forum participants. |
|
|
|
|
#3 |
|
Posts: n/a
|
Date Time issue also
I am using a php chat utility with the same problem. I am compensating for time zones still, but the posts do not reflect the correct time or change. Very annoying. Please don't make me change the code.
Thanks, Evin |
|
|
#4 |
|
Join Date: Oct 2002
Location: USA
Posts: 117
Reputation: 8
|
Bleh, new version of mysql screwed around with dates? I guess we need to mod the code then?
__________________
Sincerely, Dound |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|