Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more - View Single Post - What's the best way to put a date into a database?
View Single Post
Old 08-04-2010, 02:05 AM   #2 (permalink)
manzar
Junior Member
 
manzar's Avatar
 
Join Date: Jul 2010
Posts: 53
Default Re: What's the best way to put a date into a database?

all date calculations are done using the YYYY-MM-DD format (MySQL DATE format).

you to leave the DATE format in the db as it is, so you can do calculations, searches etc. Only re-format the date to your required format when displaying it to the user using the DATE_FORMAT MySQL command:

DATE_FORMAT(your_date, "%d-%e-%Y")
manzar is offline   Reply With Quote
Sponsored Links