Oops,
got it all wrong. Thought it was a "real" timestamp, but it's already
the date, only formatted in a different way.

The date() function expects a Unix-timestamp as its second argument.
Thus you could try to leave the conversion to MySQL by using
UNIX_TIMESTAMP(your_timestamp_column) or if you want to do it in PHP use
mktime().

http://www.php.net/manual/en/function.mktime.php

<?php
$date1="20020123143547";
$date1_year=substr($date1, 0, 4);
$date1_month=substr($date1, 4, 2);
$date1_day=substr($date1, 6, 2);
$date1_hour=substr($date1, 8, 2);
$date1_minute=substr($date1, 10, 2);
$date1_second=substr($date1, 12, 2);
$date=date("d M Y H:i", mktime($date1_hour, $date1_minute,
$date1_second, $date1_month, $date1_day, $date1_year);
?>

Hope that helps
Marcus

> have a look at http://www.php.net/manual/en/function.date.php
>
> According to your example, it would be something like:
> <?php
> $date1=date("d M Y H:i", 20020123143547);
> ?>



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to