Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- creating dates from 3-tuples
November 25, 2005, 7:24 am
rate this thread
return true for, how would I go about converting that day, month, and
year to something like September 3, 1997 using gmdate?
mktime(0,0,0,$month,$day,$year) doesn't seem to work as often as it
should (it'll occasionally return September 2, 1997 when it should
return September 3, 1997).
mktime(0,0,0,$month,$day,$year)+date('Z')+60*60*date('I') seems to work
occasionally, too, but again, it doesn't work all the time. Would
gmmktime(0,0,0,$month,$day,$year) work all the time? It works with the
limited testing I've been able to subject it to, thus far, but I don't
know if it'd work all the time.
Alternatively, what about
gmmktime(0,0,0,$month,$day,$year)+date('Z')+60*60*date('I')? With the
limited testing that I've done on that, it seems to work, too...
As for why I'm using gmdate - I'm trying to modify an existing
application, and am trying to use an existing function that already
uses gmdate. I don't want to change gmdate to date because, although
that might (or might not; I haven't tried it), I'd risk breaking other
things that used that same function...
- » Bizarre phantom bug (Calling a PHP script from an Apache "Action" directive)
- — Previous thread in » PHP Scripting Forum