Forum Moderators: coopster

Message Too Old, No Replies

Date format change

         

statiiic

10:12 am on Nov 5, 2007 (gmt 0)

10+ Year Member



HI,

I'm importing an old database of one of my clients into my new database.
However I found that his date fields gets saved in the following format.

1-12-2007
31-11-2004
etc

In my database I use unix_timestamps. Is their anyway to change that format too an unix_timestamp. I hope someone could help me. This can be in mysql code or php code

I tryed the following:

UNIX_TIMESTAMP(STR_TO_DATE('".addslashes($val)." 00:00:00', GET_FORMAT(DATETIME,'ISO'))),

DOESNT WORK hehe

Habtom

10:43 am on Nov 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



strtotime [php.net]

echo strtotime("1-12-2007");

statiiic

12:48 pm on Nov 5, 2007 (gmt 0)

10+ Year Member



Great that worked hehe

thx an lot ;)

Habtom

1:52 pm on Nov 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, statiiic.

statiiic

2:52 pm on Nov 5, 2007 (gmt 0)

10+ Year Member



haha thx an lot ;)