natalieG Posted May 29, 2006 Share Posted May 29, 2006 we have a TABLE with column descrived as DATE1 DATEif we store strings in this field as yyyy-mm-dd =2006-07-12 can this colum be used foir sorting as:SELECT * FROM TABLE ORDER NY DATE1 DESC Link to comment https://forums.phpfreaks.com/topic/10672-date-columns/ Share on other sites More sharing options...
AndyB Posted May 29, 2006 Share Posted May 29, 2006 What happens when you try it? Link to comment https://forums.phpfreaks.com/topic/10672-date-columns/#findComment-39833 Share on other sites More sharing options...
poirot Posted May 29, 2006 Share Posted May 29, 2006 Yes you can. I would however recommend you to convert them to UNIX timestamps. They have usually 10 digits and are easier to handle. Link to comment https://forums.phpfreaks.com/topic/10672-date-columns/#findComment-39877 Share on other sites More sharing options...
Barand Posted May 29, 2006 Share Posted May 29, 2006 @poirotI was born in 1949 - try storing my date of birth in a UNIX timestamp. Link to comment https://forums.phpfreaks.com/topic/10672-date-columns/#findComment-39900 Share on other sites More sharing options...
poirot Posted May 29, 2006 Share Posted May 29, 2006 [!--quoteo(post=378029:date=May 29 2006, 02:29 AM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ May 29 2006, 02:29 AM) [snapback]378029[/snapback][/div][div class=\'quotemain\'][!--quotec--]@poirotI was born in 1949 - try storing my date of birth in a UNIX timestamp.[/quote]Yes, it's a problem. Wow, you're older than my father.There are some code snippets for extended timestamps though. [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Link to comment https://forums.phpfreaks.com/topic/10672-date-columns/#findComment-40002 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.