Jump to content

Morphing dates


concordhs

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.