taith Posted May 3, 2007 Share Posted May 3, 2007 i'm pretty sure this is mktime that does this... anybody know how to translate... say day/month into a date(z) type format? Link to comment https://forums.phpfreaks.com/topic/49831-mktime-help/ Share on other sites More sharing options...
Nameless12 Posted May 3, 2007 Share Posted May 3, 2007 i'm pretty sure this is mktime that does this... anybody know how to translate... say day/month into a date(z) type format? mktime() returns a timestamp based on the parameters, dates second parameter is a timestamp so the below should work just fine. date("d-m-Y", mkdate()); if you were referring to date(z) as in date('z') just do date("z", mkdate()) Link to comment https://forums.phpfreaks.com/topic/49831-mktime-help/#findComment-244421 Share on other sites More sharing options...
taith Posted May 3, 2007 Author Share Posted May 3, 2007 yes... but that would return todays... i need to be able to return any day's date(z)... Link to comment https://forums.phpfreaks.com/topic/49831-mktime-help/#findComment-244426 Share on other sites More sharing options...
akitchin Posted May 3, 2007 Share Posted May 3, 2007 if the date is in an english language format, you can use strtotime() which will return a timestamp that you can use with date(). otherwise, yes, mktime() does this using numerical values. see the manual for the parameters: http://ca3.php.net/manual/en/function.mktime.php Link to comment https://forums.phpfreaks.com/topic/49831-mktime-help/#findComment-244435 Share on other sites More sharing options...
taith Posted May 3, 2007 Author Share Posted May 3, 2007 YAY! thanks guys... heres what i came up with function datez($day,$month,$year){ return date(z,mktime(0,0,0,$month,$day,$year)); } Link to comment https://forums.phpfreaks.com/topic/49831-mktime-help/#findComment-244440 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.