| | |
2038 Problem
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Hi,
After completing my Date class, I realize that I am suffering from the 2038 problem. (As described here-> http://pw1.netcom.com/~rogermw/Y2038.html). Does anyone know which libraries (or which code) I need to switch to on *nix systems to overcome this? (I know windows has someting like mktime64 (instead of mktime).
Google returns lots of info about the problem, nothing really about the solution...
Thanks,
Winbatch
After completing my Date class, I realize that I am suffering from the 2038 problem. (As described here-> http://pw1.netcom.com/~rogermw/Y2038.html). Does anyone know which libraries (or which code) I need to switch to on *nix systems to overcome this? (I know windows has someting like mktime64 (instead of mktime).
Google returns lots of info about the problem, nothing really about the solution...
Thanks,
Winbatch
Could you describe your problem with this in more detail?
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Sure, basically I have a date class that I wrote which wraps time_t. time_t and its associated functions mktime, localtime, etc do not function after January 19, 2038. (This is a known issue and is not related to my specific class). Attempts to use dates greater than that cause undefined behavior. (Basically attempting to go over the maximum value of an int).
My question was whether there are replacements for time_t (standard C++ only) that can deal with this. (I'm covered on windows since they created a time_64)
My question was whether there are replacements for time_t (standard C++ only) that can deal with this. (I'm covered on windows since they created a time_64)
From some bits I'd read a while ago, that I haven't been able to find again, it's a problem for the generated executable -- not necessarily the source code. For example, in 2011 the world runs 64-bit workstations: you recompile with a 64-bit unsigned int-based time_t and you're fine for a good while. Running today's application for the next 33 years, however, would be problematic.
But unfortunately, I haven't dug up any current non-standard replacement functions.
But unfortunately, I haven't dug up any current non-standard replacement functions.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Which flavor of Unix (not that my searches will be any better than yours)? And what target processor?
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
•
•
Join Date: Apr 2005
Posts: 32
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by winbatch
SunOS ... 5.8 Generic_108528-14 sun4u sparc SUNW,Sun-Fire-280R
(Basically, solaris 8), using Forte 7 compiler.
Just my thoughts.
•
•
•
•
Originally Posted by sinrtb
all it does is takes the amount of seconds since sometime in 1969 and using division seperates it into days years and dates.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Other Threads in the C++ Forum
- Previous Thread: A Begginner Needs your help!!!!
- Next Thread: Playing with shared memory - problem with non 'simple' data types
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector visualstudio win32 windows winsock word wordfrequency wxwidgets






