Re: String to Date and Date to String Functions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux