-3

Possible Duplicate:
PHP convert one date into another date format

2011-09-06 needs to be converted to a format like 2011-09-06T00:00:00.0000000

I did Google it and I was not clear on the the solutions.

Thank you for your assistance

Community
  • 1
  • 1
Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169
  • There are about 3,000 questions on Stack Overflow that deal with converting one date to the other in PHP. http://stackoverflow.com/search?q=php+convert+date – Pekka Oct 06 '11 at 19:32
  • See e.g. [PHP : Function to convert the date format](http://stackoverflow.com/q/6421304) – Pekka Oct 06 '11 at 19:32
  • Anyway, what you need is 1. strtotime() http://php.net/strtotime – Pekka Oct 06 '11 at 19:35
  • And 2. date() http://php.net/manual/en/function.date.php – Pekka Oct 06 '11 at 19:35

1 Answers1

1

Without going too deep into a well-documented problem, or trying to figure out where you are confused, some things to consider are:

  1. Converting the DATE field in your table to a DATETIME field
  2. Selecting the date field using the DATE_FORMAT function.
  3. Using PHP's strtotime and date functions to convert the format to the way you like.
DaveL
  • 339
  • 4
  • 14