Drupal newbie question. I am attempting to place the present date/time right into a SQL database like a unix timestamp. It's working for the reason that I am not receiving a mistake however it just card inserts exactly the same value each time (2147483647). I am focusing on a localhost (in the event that is important) and also have attempted the next, routinely without success:

format_date(strtotime('now'), 'custom', 'YYYY-MM-DD 00:00:00'); 

format_date(time(), 'custom', 'YYYY-MM-DD HH:MM:SS'); 

format_date(mktime(), 'custom', 'YYYY-MM-DD HH:MM:SS');

The PHP function time() return the present UNIX timestamp. equivalent with strtotime("now"). ALso if you wish to place within the database the present timestamp you may create the area within the database as TIMESTAMP using the default option CURRENT_TIMESTAMP as well as directly in SQL you are writing my_time_stamp_area = NOW().

Also...for those who have a custom date you should use mktime() http://www.php.net/manual/en/function.mktime.php The unix timestamp is definitely an int value, in your soul example you'll need a formatted datetime, if this sounds like the situation use date('YYYY-MM-DD HH:MM:SS', time()/unix timestamp/).

Hope it will help.