php-db | 2001051
Date: 05/10/01
- Next message: Benny: "[PHP-DB] problem with dbase_replace_record()"
- Previous message: Sean Weissensee: "[PHP-DB] Date formats from Postgres"
- In reply to: Sean Weissensee: "[PHP-DB] Date formats from Postgres"
- Next in thread: Steve Brett: "[PHP-DB] Date formats from Postgres"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Greetings, Sean!
At 10.05.2001, 14:08, you wrote:
SW> I am reading a data datatype from a PostgreSQL database,
SW> the format sohwing is 2001-01-05 for the 1st of May this year,
Isn't it 2001-05-01?
SW> I need this date in Australian format i.e. 01/05/2001,
SW> I tried using the string date (string format [, int timestamp])
SW> but with no success.I am not sure how to convert the database variable into
SW> a timestamp.
SW> any suggestions ?
Well, you can either convert the date to UNIX timestamp using
date_part('epoch', <your field>)
in the query and then apply PHP's date to the result or convert
it directly to the required format using
to_char(<your field>, 'DD/MM/YYYY')
-- Yours, Alexey V. Borzov, Webmaster of RDW.ru-- 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: Benny: "[PHP-DB] problem with dbase_replace_record()"
- Previous message: Sean Weissensee: "[PHP-DB] Date formats from Postgres"
- In reply to: Sean Weissensee: "[PHP-DB] Date formats from Postgres"
- Next in thread: Steve Brett: "[PHP-DB] Date formats from Postgres"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

