If i store dates in the database in the datetime form of
YYYY-MM-DD HH:MM:SS (which i believe is somehow standard, correct me if im wrong)
How in php once i have taken that date from the database, can i separate the components and store them in separate variables ($year,$month,$day...)
Dates Separation
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
If it really does come out of the database in that exact format just a substr() should do it....
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
DATE_FORMAT() works wonders.
- harrisonad
- Forum Contributor
- Posts: 288
- Joined: Fri Oct 15, 2004 4:58 am
- Location: Philippines
- Contact:
re:
read the PHP manual on how to use date() function