From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from icebubble.org ([174.136.103.210]) by ewsd; Sun Apr 12 20:21:37 EDT 2020 Received: from petunia by icebubble.org with local-bsmtp (Exim 4.76) (envelope-from ) id 1jNmz1-0003If-Qx for 9front@9front.org; Mon, 13 Apr 2020 00:29:51 +0000 Received: from rusat by cmarib.ramside with local (Exim 4.72) (envelope-from ) id 1jNhJy-00072J-9T for 9front@9front.org; Sun, 12 Apr 2020 18:27:06 +0000 From: magma698hfsp273p9f@icebubble.org To: 9front@9front.org Subject: Re: Date and time handling. References: <09D185393BD8E86D37288FC967E7EA69@eigenstate.org> Date: Sun, 12 Apr 2020 18:27:06 +0000 In-Reply-To: <09D185393BD8E86D37288FC967E7EA69@eigenstate.org> (ori@eigenstate.org's message of "Tue, 7 Apr 2020 20:56:06 -0700") Message-ID: <86k12kh85h.fsf@cmarib.ramside> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: advanced virtualized high-performance table HTML over HTML hypervisor standard-aware generator ori@eigenstate.org writes: > vlong abs; /* milliseconds since Jan 1 1970, GMT */ Do you really mean "GMT" or "UTC"? > int sec; /* seconds (range 0..59) */ > int min; /* minutes (0..59) */ > int hour; /* hours (0..23) */ > int mday; /* day of the month (1..31) */ > int mon; /* month of the year (0..11) */ The "sec" field should probably be 0..60, to allow for leap seconds. Why do you specify the month as 0..11, rather than 1..12? > int tzoff; /* time zone delta from GMT */ Is the value in tzoff specified in seconds? Does a negative value mean east or west of GMT? > Time zones are represented as strings. They can be provided > as the abbreviated timezone name, the full timezone name, > the path to a timezone file, or an absolute offset in the > HHMM form. Is that HHMM allowed to have a leading +/- sign? > Tmtime converts the millisecond-resolution timestamp 'abs' > into a Tm struct in the requested timezone. If abs has millisecond resolution, and secs resolution of one second, then where in struct Tm do the fractional seconds go? > 6,2006 > The year in 2 and 4 digit forms, respectively. (2006 - 1900) != 6 > ISO-8601,RFC-3339 and RFC-2822 dates. It would also be nice to support ISO-8601 without the "T" separator between the date and time, which looks ugly and confuses people who haven't read the standard. I often use a space or "@" sign for improved readability, even though it's technically not ISO. > Tmfmt formats a Tm struct according to the format fmt. If > fmt is nil, we format as in ctime(2). At most nbuf-1 char- > actters are written into buf, which is nul-terminated. Does that (nbuf-1) count include the terminating NUL? > if(a.abs == b.abs) > print("same0); > else > print("different0); These are missing closing quotation marks. Also, how does the library handle dates prior to the Gregorian Reformation? It's nice to have input on a man page before it gets printed and bound. :) Thanks!