refiking Posted May 4, 2009 Share Posted May 4, 2009 I have a date filed in a table on the DB that has entries like this: 1240937520 What I need to know is how can I convert the current time to this format so I can insert it into the db? Quote Link to comment https://forums.phpfreaks.com/topic/156846-solved-format-date-for-entry-into-db/ Share on other sites More sharing options...
Maq Posted May 4, 2009 Share Posted May 4, 2009 strtotime? Quote Link to comment https://forums.phpfreaks.com/topic/156846-solved-format-date-for-entry-into-db/#findComment-826193 Share on other sites More sharing options...
refiking Posted May 4, 2009 Author Share Posted May 4, 2009 Thanks. I put strtotime('NOW') and it works perfectly. Quote Link to comment https://forums.phpfreaks.com/topic/156846-solved-format-date-for-entry-into-db/#findComment-826201 Share on other sites More sharing options...
Maq Posted May 4, 2009 Share Posted May 4, 2009 That's called a, "UNIX Timestamp", BTW. Quote Link to comment https://forums.phpfreaks.com/topic/156846-solved-format-date-for-entry-into-db/#findComment-826204 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.