danthemilk Posted June 15, 2009 Share Posted June 15, 2009 Hi Everyone, I can't believe I'm resorting to a message board to resolve this question, but here it is. Lets say I have variables that I've posted from a form: $year $month $day $hour $minute $second and I want to enter that information into my database with a datetime format. How do I format that information to get a variable like $mydatetime? Sorry if this is a redundant topic but I'm search retarted today Quote Link to comment https://forums.phpfreaks.com/topic/162301-simple-datetime-question/ Share on other sites More sharing options...
salathe Posted June 15, 2009 Share Posted June 15, 2009 mktime can help - http://php.net/mktime Something along the lines of: $timestamp = mktime($hour, $minute, $second, $month, $day, $year); Quote Link to comment https://forums.phpfreaks.com/topic/162301-simple-datetime-question/#findComment-856640 Share on other sites More sharing options...
danthemilk Posted June 15, 2009 Author Share Posted June 15, 2009 Thanks! I knew there was a simple solution. Quote Link to comment https://forums.phpfreaks.com/topic/162301-simple-datetime-question/#findComment-856643 Share on other sites More sharing options...
MadTechie Posted June 15, 2009 Share Posted June 15, 2009 I can't believe I'm resorting to a message board to resolve this question, but here it is. Is that an insult ? Sorry if this is a redundant topic but I'm search retarted today welcome to the board! LOL Quote Link to comment https://forums.phpfreaks.com/topic/162301-simple-datetime-question/#findComment-856652 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.