Jump to content

Date Help?


adilmarwat
 Share

Recommended Posts

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

Edited by adilmarwat
Link to comment
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...