Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Negative Date

Status
Not open for further replies.

DonP

IS-IT--Management
Jul 20, 2000
684
US
I am trying to use the gmdate function to present dates that are in the Unix date/time format, however the dates are in the '50s so are negative numbers.

This works with more recent dates (equal or post 12/31/1969) but does not work with any before that:

[tt]gmdate("l, F jS, Y \\a\\t g:i:s A", $datetime);[/tt]

Is there a variant of this that can handle the Unix date/time as a negative number? Don
don@pc-homepage.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT/2000 (only when I have to!)
 
Thanks for replying so quickly! Since the site is running on a hosted domain through an ISP, I don't have the option of compiling anything into PHP itself or editing the php.ini but if it can be run through my domain's account, one of these might work.

looks especially promising although there was not a hit or clue on the site as to what to do with it or how to install it so I'm not sure if it will work for me. I know that answering questions about other sites is not the purpose of this forum so no need to answer but I am open to any suggestions about these or for any new ones, however the datetime IS in the Unix date/time format except that it's signed.

The database is MySQL. Don
don@pc-homepage.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT/2000 (only when I have to!)
 
Thanks again. I'll ask the developer of the IDE that I use to see if it can easily accomodate additional classes. It probably can. Don
don@pc-homepage.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT/2000 (only when I have to!)
 
It turns out that the Linux/Unix server using gmdate() will handle dates back to 1901 (using Unix date/time stamp as a negative number) but my Windows development platform has the limitation back to 1970, although I suppose that is well-known already. When I tried the suggestions above and could not get them to work, I found a simple solution in the form of another library:

[tt][/tt]

It was easy to set up, uses all the same command line switches as gmdate and works both on Linux/Unix and Windows, and was a breeze to incorporate into the whole site (through the IDE) to use as needed. Don
don@pc-homepage.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT/2000 (only when I have to!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top