Converting a Unix timestamp to a datetime and back again is what we do every time we store a date in the database. ;)
There are functions for the conversion in dml.php:
1. db_format_timestamp($timestamp): Converts from a Unix timestamp into the datetime format suitable to insert into the DB.
2. db_format_tsfield($field): Generates the SQL to convert the database field from a datetime into a Unix timestamp.
Converting a Unix timestamp to a datetime and back again is what we do every time we store a date in the database. ;)
There are functions for the conversion in dml.php:
1. db_format_ timestamp( $timestamp) : Converts from a Unix timestamp into the datetime format suitable to insert into the DB.
2. db_format_ tsfield( $field) : Generates the SQL to convert the database field from a datetime into a Unix timestamp.