MasterACE14 Posted October 18, 2011 Share Posted October 18, 2011 Good Day, I'm struggling to get strtotime() to return anything. I have the following code.. $fields['birth']['day'] = 9; $fields['birth']['month'] = 7; $fields['birth']['year'] = 1982; $dob = $fields['birth']['day'].' '.$fields['birth']['month'].' '.$fields['birth']['year']; // Returns: 9 7 1982 $dob = strtotime($dob); die($dob); No matter what I do $dob isn't returning anything once strtotime() is used. I've tried matching my day/month/year 's with examples in the manual on the strtotime() page but using date() on the fields, but it still doesn't want to return anything. I feel I'm missing something simple here. Any help is appreciated. Regards, Ace Link to comment https://forums.phpfreaks.com/topic/249302-strtotime-no-result/ Share on other sites More sharing options...
salathe Posted October 18, 2011 Share Posted October 18, 2011 strtotime() does not understand that particular format of date (day<space>month<space>year). The list of accepted date formats can be found under Date Formats. Link to comment https://forums.phpfreaks.com/topic/249302-strtotime-no-result/#findComment-1280132 Share on other sites More sharing options...
MasterACE14 Posted October 18, 2011 Author Share Posted October 18, 2011 got it. Thanks salathe! $dob = (string)$fields['birth']['month'].'/'.$fields['birth']['day'].'/'.$fields['birth']['year']; $dob = strtotime($dob); Link to comment https://forums.phpfreaks.com/topic/249302-strtotime-no-result/#findComment-1280133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.