Date/Time in correct format
Jun 30
2011
2011
Comments Off
Here is a simple way to get two variables that contain the current datetime in the current user’s preferred format and in the correct database format. Use $now_user to set datetime values on SugarBean objects and $now_db to set datetime values in database queries.
- global $timedate;
-
- $now_db = $timedate->get_gmt_db_datetime();