PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > MySQL
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools Search this Thread
Old 1-13-05, 01:25 PM   #1
magicked
 
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!
 
Old 1-13-05, 01:30 PM   #2
tbonekkt
 
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.
tbonekkt is offline  
Old 1-13-05, 02:15 PM   #3
okbyethen
 
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
 
Old 1-13-05, 02:18 PM   #4
Dound
 
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
Dound is offline  
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 09:37 PM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.