Jump to content

different date format


Akasha

Recommended Posts

Hii have an form mad ein asp, when i submit the form it writes it to a mysql database.The database only understands the date format YYYY-MM-DD.Is there is simple way to change the date format into above mentioned format,cause now i am only getting DD-MM-YYYY or MM-DD-YYYY.thnx in advanceakasha

Link to comment
Share on other sites

The easiest way would be to split up the date and rearrange it if it's always going to be in the same format. How you would do that depends on the language you're using. This is how you do it in Javascript if the date starts in DD-MM-YYYY format:

chunks = dateval.split("-");newdate = chunks[2] + "-" + chunks[1] + "-" + chunks[0];

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...