RE: [PHP] String to Date and Date to String Functions?
| From: | Jay Blanchard | Date: | Mon, 24 Jan 2005 16:38:03 +0000 |
| Subject: | RE: [PHP] String to Date and Date to String Functions? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-207130@lists.php.net to get a copy of this message | ||
[snip]
Being trying to work out haw to handle dates. Basically I need a
function to convert a Date to a String and another function to convert
a string to a date.
Exactly what format the date is held in is not relevant as long as it
is some type of standard (i.e. Unix Timestamps).
Both the functions will require a format string (such ad DD/MM/YYY)
and again the format/syntax of this is irrelevant, as long as they are
the same for both .
String to Date Function
----------------------------
return date stringToDate( str Date, str Format )
e.g. $todayDt = stringToDate( '01/01/2003','DD/MM/YYYY' );
Date to String Function
----------------------------
return str dateToString( date Date, str Format )
e.g. $todayStr = dateToString ( $todayDt,'DD/MM/YYYY' );
Anyone know of any functions that do this or have pointers as to how
it can be done.
[/snip]
You've looked at http://www.php.net/date ?