Problems of conversion with strftime()

From: Date: Wed, 28 Mar 2001 16:37:01 +0000
Subject: Problems of conversion with strftime()
Groups: php.general 
Request: Send a blank email to php-general+get-45921@lists.php.net to get a copy of this message
<? setlocale("LC_ALL","es_ES"); $fecha = date("d-m-Y"); print $fecha ." <br>"; -> 28-03-2001 ok $fecha = "2001-03-28 18:22:00"; print (date("d m Y H:i:s",$fecha)) ."<br>"; ->01 01 1970 01:33:21 wrong print (date("Y m d H:i:s",$fecha)) ."<br>"; ->1970 01 01 01:33:21 wrong print (strftime("%d-%m-%Y %T")) ."<br>"; ->28-03-2001 18:22:24 ok print (strftime("%d-%m-%Y %T",$fecha)) ."<br>"; -> 01-01-1970 01:33:21 wrong ?> Who should I convert between date values? I am using postgresql date fields and the only way to format de date is using the SQL functions instead of formating with PHP functions. select to_char(date(pg_user.valuntil),'DD-MM-YYYY HH24:MI:SS') ... Any idea? Thanks in advance -- Evelio Martínez

« previous php.general (#45921) next »