Quote:
Originally Posted by ziycon I have had a go but i can't figure out how to take the dates from the record and the work with them, there all in the YYYY-MM-DD format. |
Did you try that query it extracts the date as month, year in fact it does exactly what you asked for.
MySQL has some very powerful date functions see the link Briask posted. Its much better to do all your date formating in your sql queries then in the PHP.
YYYY-DD-MM HH:MM:SS is the standard format for storing dates and is widely used avoids all that American vs European dates but the are other ways it can be stored, using the mysql date function in your query means you will always get the date format in the same way regardless of how it is stored in the db and then you won't break your php apps if it changes due to an update or changing the db.
Imagin if your converting all the dates you got from queries to unix format in your php and for some reason the date field in your db is shange to store them in unix time. What happens when you convert a unix time stamp to a unix time stamp.