Parsing Date Strings with Time Zones in c++

J

James Kanze

On 10 okt, 03:11, Jorgen Grahn <[email protected]> wrote:
[...]
Well, it goes without saying that there's always *some*
point where it breaks down, doesn't it? If they announce
tomorrow that .se will have DST all year around,
/someone/ will have to change something in software.
(What are the alternatives, anyway?)
Just instead of recording some "Stockholm time" record raw
Zulu time or local with offset mentioned "+01" "+0100"
"+01:00".
The problem isn't what you send, it's what you receive. Have
you actually seen any systems behaving this way?
I have no copy under hand so i just humbly believe that it is like ISO
8601 specifies.

Sorry, I misread what you'd written. I read it as recording raw
Zulu time with an offset so that you could know what the local
time was. What you've actually described is ISO 8601, and it is
occasionally used (albeit not as wide spread as one would like).
[...]
It's feasible for the system to keep track of past
rules[1]. I don't know if they typically do, and
frankly I don't care enough to check.
They typically don't.
Then Unix isn't typical. Do you have some concrete information
concerning Windows, or are you just speculating?
If there is Olson database present in Windows? No.

You worry me. The correct functionning of the system I'm
working on depends on being able to calculate the correct date
and time for any given time zone. (Or maybe it's not a problem,
since we're normally only concerned with times in the "standard
business" hours. A one hour error due to summer time won't
change the day, and so shouldn't cause us problems.)
Also HP-UX was bundled without.

The HP-UX I've worked on had it, but I don't know if it was
bundled.
I doubt that all the mobile devices currently up- rocketing
have it.

Maybe not resident, but they know how to get it when they need
it.

They only real problem would be for devices not connected to the
internet.
Last i dealt with timezones in Windows then Windows
had some self-breed timezone ID that was outright ambiguous. Since
zoneinfo is public domain database one may of course kick it up and
bundle with his software (and update with service packs). It is not
convenient for each application but fine for bigger special purpose
package. Raw offset is winner anyway, nothing to do.

ISO date format, in general, yes. You're certainly right about
that (and I'm sorry I misread your suggestion), But not all
sources are kind enough to supply it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,609
Members
45,254
Latest member
Top Crypto TwitterChannel

Latest Threads

Top