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? Quote 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)); Quote Link to comment https://forums.phpfreaks.com/topic/193721-varchar-to-date/#findComment-1019645 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.