Re: Re: String to Date and Date to String Functions?

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

 



Ben Edwards wrote:
> On Mon, 24 Jan 2005 12:58:52 -0500, hitek@xxxxxxx <hitek@xxxxxxx> wrote:
>> How about the strtotime() function?
>> http://us4.php.net/manual/en/function.strtotime.php
>
> No good, it douse not take a format string.  What if I wanted to
> convert the timestamp to 'DD-MM-YYY', display it on a form, validate
> it, and then convert it back to a timestamp.
>
> I cant beleve the PHP date/time functions suck this bad;(

Feel free to write an "undate" function that is the inverse of date()
since that's what you seem to want...

Though, really, since by the time it comes back to you, all you need is:

list($dd, $mm, $yyyy) = explode('-', $input_date);
$date = mktime(0, 0, 0, $mm, $dd, $yyyy);

I'm not quite sure why you think this sucks so bad...
[shrug]

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
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