Converting a date string + a time string to postgresql Times

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hthb
Forum Newbie
Posts: 5
Joined: Sun May 15, 2005 1:49 pm

Converting a date string + a time string to postgresql Times

Post 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.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Use strtotime.
strtotime (""5/16/2005 3:17pm")

Use a column in PostgreSQL as type timestamp without time zone
hthb
Forum Newbie
Posts: 5
Joined: Sun May 15, 2005 1:49 pm

Post by hthb »

Thank you!
Post Reply