gotornot Posted January 22, 2010 Share Posted January 22, 2010 Hi Im looking to generte a unix tmestamp for a certain day so i can use it to compare in db the info is posted through ie day=, month=, year=, Is there a comand i could use for example $fromunix = comand(''00:00:01','$day','$month','$year') i need 1 second past midnight and the date to compare it to will be: $tounix = comand(''23:59:59','$day','$month','$year') Any ideas? Link to comment https://forums.phpfreaks.com/topic/189445-a-time-question-help-me-lol/ Share on other sites More sharing options...
schilly Posted January 22, 2010 Share Posted January 22, 2010 have you looked into mktime()? Link to comment https://forums.phpfreaks.com/topic/189445-a-time-question-help-me-lol/#findComment-999998 Share on other sites More sharing options...
crabfinger Posted January 22, 2010 Share Posted January 22, 2010 strtotime() Link to comment https://forums.phpfreaks.com/topic/189445-a-time-question-help-me-lol/#findComment-1000000 Share on other sites More sharing options...
jl5501 Posted January 22, 2010 Share Posted January 22, 2010 Yes, as has been suggested you can use strtotime() to convert any human readable date into a unix timestamp. or the reverse can be accomplished with strftime() for which you will need to look up the various formatting options Link to comment https://forums.phpfreaks.com/topic/189445-a-time-question-help-me-lol/#findComment-1000166 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.