markvaughn2006 Posted December 22, 2010 Share Posted December 22, 2010 sorry, I know this is simple, but stuck on it... how would one go about converting 1/21/11 to a UNIX timestamp, something like 1293035229? and while we are at it, how to convert 1293035229 to 1/21/11 ? (i know the timestamp is wrong, just for example) THX!!!!! Quote Link to comment Share on other sites More sharing options...
micah1701 Posted December 22, 2010 Share Posted December 22, 2010 <?php $not_unix = "12/01/01"; $unix = strtotime($not_unix); echo $unix; ?> edit: just be careful of some traps like "MM/DD/YY" vs "YY/MM/DD" or "mm/dd/yy" vs "mm-dd-yy" check out the docs and comments at php.net/strtotime Quote Link to comment Share on other sites More sharing options...
requinix Posted December 22, 2010 Share Posted December 22, 2010 ...and date goes in the opposite direction. 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.