string to date

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
radiators
Forum Newbie
Posts: 1
Joined: Sat Aug 01, 2009 2:19 pm

string to date

Post by radiators »

hi, php experts

if i haw two strings $a = "30.07.2009" and $b = "2009-07-30";

how can i convert thes strings to new strings for putting in mysql table?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: string to date

Post by califdon »

radiators wrote:hi, php experts

if i haw two strings $a = "30.07.2009" and $b = "2009-07-30";

how can i convert thes strings to new strings for putting in mysql table?
That depends entirely on what data type you use for the column in your table.
Read this: http://www.bigroom.co.uk/blog/dates-in-php-and-mysql
Post Reply