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
hthb
Forum Newbie
Posts: 5 Joined: Sun May 15, 2005 1:49 pm
Post
by hthb » Mon May 16, 2005 2:49 pm
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.
anjanesh
DevNet Resident
Posts: 1679 Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India
Post
by anjanesh » Tue May 17, 2005 1:17 am
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 » Tue May 17, 2005 9:48 am
Thank you!