adilmarwat Posted March 8, 2010 Share Posted March 8, 2010 I have table in mysql and contains date(date) which is contains 2070-06-30.When I provide the following statement in php echo date('d-m-Y', strtotime($row['date'])); it gives 01-01-1970.How I get my desire date of table field.please help?Adil Link to comment Share on other sites More sharing options...
justsomeguy Posted March 8, 2010 Share Posted March 8, 2010 Instead of using strtotime, use explode to break the date up into pieces and then use mktime to get the timestamp for that date. strtotime only works well with US-formatted dates, so if you want to use strtotime then you'll need to have the database format the date field to work with strtotime. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.