How Do You Convert A String To Date


Subject: How Do You Convert A String To Date
Hi Guys,

I have a string eg - 21/07 which represents a date, i need to upload it to a database in 21/07/09 format, how can i do this with PHP, i know how to update the database, but how do i convert string ( eg 21/07) to a date format ( dd/mm/yy )

regards

Subject: Re: How Do You Convert A String To Date
hey andy,

if you want to have the date for IcyPhoenix... its better to note convert the string in a date... its better to use the UNIX timestamp... then you can call the timestamp with the create_date_ip() function from Icy...

this might be helpfull for you http://www.php.net/manual/en/function.strtotime.php

Subject: Re: How Do You Convert A String To Date
Better than thousands words:

http://it2.php.net/manual/en/function.date.php

http://it2.php.net/manual/en/function.gmdate.php

http://it2.php.net/manual/en/function.mktime.php

http://it2.php.net/manual/en/function.gmmktime.php

Subject: Re: How Do You Convert A String To Date
Thanks guys, got that sorted and now having problems with something else to worry about LOL

Ahhh the joys of writing code !!


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.0917s (PHP: 18% SQL: 82%)
SQL queries: 10 - Debug Off - GZIP Enabled