| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | EMX & TZ-environment var |
EH> > JdeBP> A time_t is a time_t, and (for your compiler) it > JdeBP> is always a POSIX 1003.1 seconds-since-The-Epoch number. The > JdeBP> value of the TZ environment variable doesn't change the number. > > Then I don't understand that FleetStreet does not > understand the number (posix date value) I write to a *.MSG > file when the TZ variable is set. > In the case the TZ variable is not set FleetStreet does > understand the posix date value written to the *.MSG file... EH> Is it the same value in the file in both cases ? Did you check ? You certainly haven't said whether it is or not. You aren't expressing yourself very well. All that I can infer from "FleetStreet doesn't understand the number" is that it prints the wrong human-readable calendar time when displaying the message, because obviously FleetStreet *does* understand the number (how can a program "not understand" a 32-bit number ?). It's very important to accurately describe the symptoms when you are asking for help with a problem. Vague terms like "doesn't understand" are as useless as "doesn't work". Exact behavioural descriptions please. ... preferably accompanied by the values in the file, and some snippets from the code that you are using to obtain those values in the first place. Anyway, to print a human-readable calendar time when you have a `time_t', one usually calls localtime() and strftime(). In the next paragraph of my original message, you will find that I said : EH> > JdeBP> The value of the TZ environment variable changes the way that this > JdeBP> number is translated into a "broken-down time" (i.e. a `struct tm') > JdeBP> by the localtime() function. EH> And the reverse is true, as well. The TZ environment variable affects the way that a "broken-down time" (i.e. a `struct tm') representing local time is translated into a `time_t' by the mktime() function. EH> > JdeBP> The TZ environment variable is defined by POSIX, but not all C/C++ > JdeBP> compilers use it the same way (or even at all), since it isn't part > JdeBP> of the Standard C Language (the conversion that localtime() > JdeBP> performs is implementation-defined in Standard C, AFAIAA). > > What do you mean by implementation-defined: the exact code > lines are defined, or the results are defined? EH> The conversion that localtime() performs betweem its argument and its result is implementation-defined. > JdeBP < ___ X MegaMail 2.10 #0: --- Maximus/2 3.01* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4) SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934 SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1 @PATH: 440/4 141/209 270/101 712/515 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.