Here's the situation. I update some datetime fields in a "before save" hook like so:
PHP Code:
$userDate = new TimeDate();
$date_format = $userDate->get_date_time_format();
$bean->decision_sent_date = date($date_format);
This is fine. It stores the time in GMT in the db which displays fine in Sugar based on my timezone setting.
In an "after save" hook, I try to update another field by the following:
PHP Code:
$db = & DBManagerFactory::getInstance();
$updateLogisticsInDate = "update tmpprocedure set logistics_in = GETDATE() where id = '".$bean->id."'";
$db->query($updateLogisticsInDate);
This however saves a datetime value that is my local current time (EST). So, I just ran my script now, and "2010-12-22 00:17:00.000" gets stored for "decision_sent_date" (which is GMT), but "2010-12-21 19:17:44.067" gets stored for "logistics_in" (which is EST). How do I fix this so that I have consistent datetime values that get stored in the db?
Thanks!
Bookmarks