Optional 2nd param for date() and strftime() is UNIX timestamp (i.e. integer -
seconds from epoch)
So I suppose all works as it should.

--
Yasuo Ohgaki


"Evelio Martinez" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> <?
> 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
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to