Date: 11/15/00
- Next message: Joe Lloyd: "Re: [PHP-DB] Mssql insert problem"
- Previous message: Mike: "[PHP-DB] Mssql insert problem"
- In reply to: kenji chan: "[PHP-DB] Data / Time problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
If you know that the date returned in $fromMysql is a date in YYYYMMDD
format, why not just do something like this:
$year = substr($fromMysql, 0, 4) ;
$month = substr($fromMysql, 4, 2) ;
$day = substr($fromMysql, 6, 2) ;
$thedate = $year."/".$month."/".$day ;
HTH
Sam Masiello
System Analyst
Chek.Com
(716) 853-1362 x289
smasiello <email protected>
-----Original Message-----
From: kenji chan [mailto:kenjikenji <email protected>]
Sent: Wednesday, November 15, 2000 3:01 PM
To: php-db <email protected>
Subject: [PHP-DB] Data / Time problem
Data / Time problem:
How to format a date from Mysql column ( timestamp(8) ) to "Year / Month /
Day" ?
I got a problem , For examlp :
*********
$fromMysql = "19811229";
echo date("Y / m / d", $fromMysql);
*********
I would like to see 1981 / 12 /29 ,but I got the result :
1970 / 08 / 18
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Joe Lloyd: "Re: [PHP-DB] Mssql insert problem"
- Previous message: Mike: "[PHP-DB] Mssql insert problem"
- In reply to: kenji chan: "[PHP-DB] Data / Time problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

