|
Posted by J.O. Aho on 03/02/07 18:54
Steve wrote:
> as it is, i'm more interested in seeing the different approaches people
> take. yours is 3 lines of code, nice and concise. i opted for six
> non-commented lines hoping the 'last monday' textual method would both
> return the values expected and serve as commantary at the same time.
> i like the way you've done it!
Yes, and we had three different ways to do things in a quite short timespan.
I agree with you about your method, myself I always forget the strtotime() and
how to use it with ease and it has been that I have reinvented the wheel with
making my own version to take a date in text format parse it and then feed it
to mktime() to get the unixtime.
> the good news is, there are always more cats
> than the almost infinite number of ways one could skin them. ;^)
It's both good and bad, as not all the solutions are good ones, as the one I
thought of before I posted my code, it's been a lot longer and really a pita
to debug.
--
//Aho
[Back to original message]
|