Fearpig Posted May 21, 2007 Share Posted May 21, 2007 Hi Guys, This is probably a really simple one but I'm not sure what I should be searching for. I've got three integers - Day, Month and Year, how do I convert them into a date value? Could someone point me in the right direction? Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/52314-solved-make-a-date-out-of-day-month-and-year/ Share on other sites More sharing options...
jitesh Posted May 21, 2007 Share Posted May 21, 2007 echo date("Y-m-d",mktime(0,0,0,$month,$day,$year)); Quote Link to comment https://forums.phpfreaks.com/topic/52314-solved-make-a-date-out-of-day-month-and-year/#findComment-258101 Share on other sites More sharing options...
MadTechie Posted May 21, 2007 Share Posted May 21, 2007 try <?php $nDate = mktime(0, 0, 0, $Month, $Day, $Yr); ?> edit: jitesh is nicer Quote Link to comment https://forums.phpfreaks.com/topic/52314-solved-make-a-date-out-of-day-month-and-year/#findComment-258102 Share on other sites More sharing options...
Fearpig Posted May 21, 2007 Author Share Posted May 21, 2007 Thanks Jitesh helped me out again! Quote Link to comment https://forums.phpfreaks.com/topic/52314-solved-make-a-date-out-of-day-month-and-year/#findComment-258107 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.