VOGONS


Delta V CD with sound

Topic actions

Reply 20 of 22, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

hmm would using gmtime/mktime instead of localtime help ?

(which function does it use to test the time ?)

and where is exactly stored what the timezone of the cdrom was.

Water flows down the stream
How to ask questions the smart way!

Reply 21 of 22, by Kippesoep

User metadata
Rank Oldbie
Rank
Oldbie

An HSG directory entry has one byte, offset 0x18, which stores the timezone as the offset from GMT/Zulu in number of 15 minutes intervals from -48(West) to +52(East).

My site: Ramblings on mostly tech stuff.

Reply 22 of 22, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

gmtime() gets you GMT (Greenwich Mean Time, I assume that's what others mean with "Zulu Time"), although these days it's officially called UTC (Coordinated Universal Time). It uses the OSes information about time zones to do that. Actually, it's the other way round: localtime() translates a Unix Timestamp, the number of seconds since 1.1.1970, 00:00 UTC, into local time, while gmtime does no translation.

Here's a little trick: If you know the offset in seconds (according to Kippesoep that would be 15*60*X, where X is that timezone byte), you can set the external variable "timezone" to that value, and localtime() then translates into that timezone. Just make sure you call "tzset();" (exactly that way) once before you change "timezone". These two functions are part of POSIX, so should work everywhere but on MSVC.

I did a little more resarch: MSDN tells me that on MSVC, they are called _tzset and _timezone, so it's just an additional underscore.

And if you don't find a way to fetch timezone information from CD, here's a wild guess:

If this information cannot be obtained, PST8PDT, which signifies the Pacific time zone, is used by default.

Perhaps because of this default, many (all?) old CDs are in the time zone as the one discussed earlier.