There's a problem with Mike's low-res-time function: fun rfc1123_date (dt:&tm) => strftime("%a, %d %b %Y %H:%M:%S %Z",dt);
because it uses the %Z specifier and strftime. The result of strftime and localtime() functions are indeterminate. My rough view is: local times should never be used. Time zone names also shouldn't be used. Instead, the only permitted timezones should be: UTC UTC+0230 UTC-0600 i.e. UTC, or UTC+/- 4 digits represent 24 hour clock format offset. A time without a zone should be considered to mean UTC. A time for a local timezone can be easily adjusted to UTC this way. GMT is not a time standard. The strftime function should never be used with %Z, because the time zone is indeterminate. See Posix standard. In the actual test code, we get a failure because we start with an absolute (GMT) time, parse it into a tm_ structure thing, and in doing so the timezone is lost. Then strftime goes and puts in the local timezone. I've annoyed Mike by changing the *.expect to what my Mac says: it says the AEDST time is "EST" which is also wrong. EST means American Eastern Standard Time. AEST is for Australia. I have no idea what Sydney DST is called (note QLD doesn't use daylight saving, so it's always AEST). We need to figure a way to handle this. We need to ensure somehow, possibly using the type system, that *standard* time values, which means UTC or Posix time don't get mixed up with local times. This is also critical for file times (as in fstat etc). The "defacto" Felix standard for times is type: double base: Posix (1 Jan 1970) unit: seconds Anything that muddles with tm_ struct should be private, to prevent the user getting at it. I'd rather see Felix provide it's own sane functions than use the rubbish in C/Posix. Of course we have to make *string* times which are compliant with network standards. -- john skaller skal...@users.sourceforge.net ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language