Article View: comp.std.c++
Article #3144Time representations
From: Max TenEyck Woodbury
Date: Wed, 31 Jan 1996 04:24
Date: Wed, 31 Jan 1996 04:24
29 lines
2011 bytes
2011 bytes
The C++ standard incorporates the C standard for dates and times
by reference. There are at least three problems with the 'struct tm'
definition in that standard.
First, the range specified for tm_sec is 0-59. While this is the
normal range for almost all minutes, there are officially 'leap
seconds' that are declared from time to time. The standard should
reflect this possibility, even if it is almost always ignored in
practice.
Second, there are cultures that operate on a lunar calendar,
rather than on the Gregorian calendar. They have 13 or more months
a year. The tm_mon range needs to reflect this.
Third, there are cultures that do not start their year on January
1st. This has an impact on the definition of tm_yday even though
its range will not change. There is a similar definitional problem
with tm_year.
There may also be a problem with tm_wday. I vaguely remember
hearing about cycles of 17 or 19 days used in some cultural contexts
that might have been in addition to or in place of the weekly cycle,
but I can not remember the exact context.
Max
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<4emq2k$ecu@news.duke.edu>Path:
arc1-ca.pugleaf.net!fido.asd.sgi.com!austernShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!fido.asd.sgi.com!austern From: Max TenEyck Woodbury <mtew@cds.duke.edu> Newsgroups: comp.std.c++ Subject: Time representations Date: 30 Jan 1996 20:24:13 PST Organization: Duke University Center for Demographic Studies Approved: austern@isolde.mti.sgi.com Message-ID: <4emq2k$ecu@news.duke.edu> NNTP-Posting-Host: isolde.mti.sgi.com X-Original-Date: 31 Jan 1996 04:09:55 GMT X-Mailer: Mozilla 1.1N (Windows; I; 16bit) X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBMQ7vAEy4NqrwXLNJAQHWPgIAyDcbV5weUnyBGwaxBmOxnzT6ntmWDOZd lJ2k6tsbkuZQtxx199oGs71wp5HQUDhyCb467nl70XrH+DRywYszCw== =qJT8 Originator: austern@isolde.mti.sgi.com