concordhs Posted November 16, 2009 Share Posted November 16, 2009 Hey all, Whats new? So i need to change the format of a date thats stored in a database. I'm trying to avoid adding another field to the database, id prefer to mould the date already stored in the database to the new format So, The date being stored at present is this Saturday, November, 14th 2009. 12:32 pm To run through this other script i have, it needs to mould to this format // hour (24hr time) - minute - seconds / month - day - year $start = mktime(03,00,00,06,08,2009); so the database is already populated with 300 odd records, so id rather not have to manually convert em all. So my question would be, is there a way to morph the first date into the second date? My friend suggesting an array then using switch statements, i tried for a bit, but couldnt get anywhere, mainly because they arent seperated by the same escape charecter. If it will be way too hard to mould, ill just add another field.... but again, would prefer not to Thanks all, much appreciated Link to comment https://forums.phpfreaks.com/topic/181700-morphing-dates/ Share on other sites More sharing options...
Mchl Posted November 16, 2009 Share Posted November 16, 2009 1. Don't store dates like that 2. strtotime should be able to parse that 3. Don't store dates like that (and if you want to change it to normal DATETIME format, you can do this with three queries probably) Link to comment https://forums.phpfreaks.com/topic/181700-morphing-dates/#findComment-958316 Share on other sites More sharing options...
concordhs Posted November 16, 2009 Author Share Posted November 16, 2009 1. Yeah, my bad :-[ *please dont kill me* 2. Going to try now, thanks 3. Im considering it! Link to comment https://forums.phpfreaks.com/topic/181700-morphing-dates/#findComment-958321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.