Page 1 of 1

Converting a date string + a time string to postgresql Times

Posted: Mon May 16, 2005 2:49 pm
by hthb
Hi.

I have two strings (got from a web service).

Date: "5/16/2005"
Time: "3:17pm"

I want to insert this a a timestamp into a field in a Postgresql database.

Is there a php function or a hack that does that for me?

Thanks in advance.

Posted: Tue May 17, 2005 1:17 am
by anjanesh
Use strtotime.
strtotime (""5/16/2005 3:17pm")

Use a column in PostgreSQL as type timestamp without time zone

Posted: Tue May 17, 2005 9:48 am
by hthb
Thank you!