PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 20th, 2002, 09:49 AM
kgonikman kgonikman is offline
wild cat
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Germany / Russia
Posts: 8 kgonikman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to kgonikman
Angry 2038 bug

Does anyone have a solution for the Y2038K bug in the mktime()/date() functions?

Reply With Quote
  #2  
Old February 20th, 2002, 10:00 AM
costas costas is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 7 costas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
what the heck IS the Y2038 bug in these functions? What are the symptoms?

Reply With Quote
  #3  
Old February 20th, 2002, 10:07 AM
kgonikman kgonikman is offline
wild cat
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Germany / Russia
Posts: 8 kgonikman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to kgonikman
You cannot generate a date bigger than 19 Jan 2038 03:14:07 GMT


echo date("Y-m-d", mktime(0,0,0,1,1, 2002 + 60)) // year 1970.....



Manual says:
Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer.)

Reply With Quote
  #4  
Old February 20th, 2002, 10:21 AM
deepspring's Avatar
deepspring deepspring is offline
Is a Psycho
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: In your computer
Posts: 231 deepspring User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to deepspring Send a message via Yahoo to deepspring
Beats me why your worryin about it, by the year 2038 you will probably be using a new version of PHP in your brain implant (like Johnie Neumonic or The Matrix)...

Though it may help to drop PHP/Zend/Whoever a note... so they know for future reference.

__________________
deepspring

- "Netscape 4 users are like lemmings... You can't help but laugh when one falls off a cliff"

Reply With Quote
  #5  
Old February 20th, 2002, 10:26 AM
jonsagara's Avatar
jonsagara jonsagara is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: USA
Posts: 286 jonsagara User rank is Private First Class (20 - 50 Reputation Level)jonsagara User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 m 23 sec
Reputation Power: 8
64-bit microprocessors. 2^64 = a whole lot of milliseconds.
__________________
Jon Sagara

"Me fail English? That's unpossible!"

Reply With Quote
  #6  
Old February 20th, 2002, 10:27 AM
kgonikman kgonikman is offline
wild cat
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Germany / Russia
Posts: 8 kgonikman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to kgonikman
Because I'm writing an statistic application that must calculate over the year 2038, too....

Reply With Quote
  #7  
Old February 20th, 2002, 05:03 PM
Matt Light's Avatar
Matt Light Matt Light is offline
Web Programmer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 362 Matt Light User rank is Lance Corporal (50 - 100 Reputation Level)Matt Light User rank is Lance Corporal (50 - 100 Reputation Level)Matt Light User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 2 Days 10 h 11 m 37 sec
Reputation Power: 8
It's not a problem with PHP, I don't believe. It's a problem with Unix/Linux... I think it is limited to this because of the timestamp the string it will generate.
__________________
Matt Light
Web Programmer

Reply With Quote
  #8  
Old February 20th, 2002, 08:01 PM
deepspring's Avatar
deepspring deepspring is offline
Is a Psycho
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: In your computer
Posts: 231 deepspring User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to deepspring Send a message via Yahoo to deepspring
Quote:
Because I'm writing an statistic application that must calculate over the year 2038, too....


whoa, thats a longgggg way in the future... why so far down the track?

Reply With Quote
  #9  
Old February 21st, 2002, 02:35 AM
Taradino Taradino is offline
Python Prophet
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Amersfoort, The Netherlands
Posts: 45 Taradino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Re: 2038 bug

Quote:
Originally posted by kgonikman
Does anyone have a solution for the Y2038K bug in the mktime()/date() functions?

Write your own functions. It's that simple. These functions all depend on the timestamps(in seconds) since the Unix epoch(1-1-1970), and these will overflow above 2038.
You could try finding 'algorithm 199: conversions between calendar date and Julian day number' from Communications of the ACM, which seems to be a way to fix the problem. They're probably a few implementations somewhere on the web, but I don't think you can get the original magazine anymore, it's from 1964.
__________________
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. - Jamie Zawinski, in comp.lang.emacs

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > 2038 bug


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT