php-general | 2000071
Date: 07/15/00
- Next message: Peter Van Dijck: "[PHP] yahoo like php script"
- Previous message: Richard Heyes: "RE: [PHP] Expire"
- In reply to: Php User: "[PHP] timezone problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, 15 Jul 2000, Php User wrote:
> when I use strtotime() to convert a postgre timestamp to a UNIX timestamp, the
> milliseconds returned always have 8 hours added into it (my timezone is Taiwan
> which is eight hours away from GMT). Then I try the following:
>
> strtotime(date("l, F j, Y g:ia T"))
> This date() can return the correct date for today but the UNIX timestamp
> returned by strtotime is different from the one returned by microtime().
You could save yourself some time and just ask PostgreSQL to return the
timestamp.
select date_part('epoch', your_column) from your_table;
-- Jouni Ahto
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Peter Van Dijck: "[PHP] yahoo like php script"
- Previous message: Richard Heyes: "RE: [PHP] Expire"
- In reply to: Php User: "[PHP] timezone problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

