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? Quote Link to comment Share on other sites More sharing options...
schilly Posted January 22, 2010 Share Posted January 22, 2010 have you looked into mktime()? Quote Link to comment Share on other sites More sharing options...
crabfinger Posted January 22, 2010 Share Posted January 22, 2010 strtotime() Quote Link to comment 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 Quote Link to comment 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.