<?
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


Reply via email to