stig1 Posted March 1, 2010 Share Posted March 1, 2010 I am access information from a ibm db2 (as400) database system. We have a field that stores dates but they are stored in a varchar (character) field type. When the data (date) come out, they are 'yyyymmdd'. How would I go to format that string into dd-mm-yyyy? Link to comment https://forums.phpfreaks.com/topic/193721-varchar-to-date/ Share on other sites More sharing options...
JasonLewis Posted March 1, 2010 Share Posted March 1, 2010 Use a combination of date and strtotime. $date = date("d-m-Y", strtotime($database_date)); Link to comment https://forums.phpfreaks.com/topic/193721-varchar-to-date/#findComment-1019645 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.