Re: String to Date and Date to String Functions?
| From: | Jason Wong | Date: | Tue, 25 Jan 2005 00:20:05 +0000 |
| Subject: | Re: String to Date and Date to String Functions? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207189@lists.php.net to get a copy of this message | ||
On Tuesday 25 January 2005 08:07, Ben Edwards wrote:
> As I have said in a previous email to date function takes a format
> string and the strtodate douse not. Therefore the strtodate() only
> works on a small subset of what date() can produce. The format I am
> interested in is DD-MM-YYYY which is the way dates are specified in
> the UK, strtodate() cant handle this.
If that is the *only* format you're interested in then why the argument
'Format'? It's surplus to requirements.
> return str dateToString( date Date, str Format )
> strtodate is not the reverse of
> date.
No, but it's not exactly hard to write a function to change DD-MM-YYYY into a
timestamp. explode() should get you on your way, and examples abound in the
archives.
The thing with PHP is that you're not limited to using the built-in functions,
you can write your own (fancy that).
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts