You are here: creating dates from 3-tuples « PHP Programming Language « IT news, forums, messages
creating dates from 3-tuples

Posted by yawnmoth on 11/25/05 09:24

Given a 3-tuple of some day, month, and year that checkdate would
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...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация