POV-Ray : Newsgroups : povray.beta-test : POV-Ray v3.8.0-beta 1 - Parse error using "%s" in Win10 : Re: POV-Ray v3.8.0-beta 1 - Parse error using "%s" in Win10 Server Time
19 Apr 2024 18:41:12 EDT (-0400)
  Re: POV-Ray v3.8.0-beta 1 - Parse error using "%s" in Win10  
From: William F Pokorny
Date: 29 Jul 2021 07:45:12
Message: <610294c8$1@news.povray.org>
On 7/28/21 5:53 PM, clipka wrote:
> Am 28.07.2021 um 15:16 schrieb William F Pokorny:
> 
>> Just to toss it out there, for as long as I've used datetime(now) as in:
>>
>> #version 3.8;
>> #debug concat("v3.8 default -> ",datetime(now),"\n")
>>
>> I've gotten back:
>>

>>
>> because the default format strings has a 'Z' on the end where I 
>> suspect ' %Z' was intended. In the povr branch I changed to ' %z' as I 
>> think the time offset more general.
> 
> The `datetime` function with default values works as documented:
> 
> "The default for the STRING parameter format is %Y-%m-%d %H:%M:%SZ"
> 
> 
> I'm not the author of that functionality, but according to my 
> understanding, this is entirely intentional:
> 
> Since the information provided by "now" is based on UTC, and the 
> `strftime` conversion specifiers are time zone agnostic(*), the printed 
> date and time are also with respect to UTC.
> 
> In full compliance with ISO 8601, this is indicated by appending a 
> literal uppercase `Z` right after the time, which is the official time 
> zone designator for UTC.
> 
> 
> (*)Except for `%Z` or `%z` of course.
> 
> Speaking of which: Appending either of those instead of "Z" would 
> actually give a wrong time, unless you first convert `now` to local time.
> 
> Also, per ISO 8601 any time zone designator should be appended to the 
> time without any intervening space.

Supposing the SDL:

    #debug concat("",datetime(now),"\n")
    #debug concat("",datetime(-100000),"\n") // (*)

And the 'date' command on my Ubuntu 20.04 computer returning:

     Thu 29 Jul 2021 07:15:12 AM EDT

The v3.8 branch returns:

     2021-07-29 06:15:12Z  <-- Not current Zulu time... (**)
     1726-03-18 00:00:00Z

The povr branch returns:

     2021-07-29 06:15:13 -0400 <-- Not my current dst time. Offset wrong.
     2021-07-29 07:15:13 -0400 <-- This is correct.

Bill P.

(*) The -100000 days is somewhat arbitrary. Just needs to be earlier 
than the unix epoch time to trigger the dst aware mode.

(**) Using %Z would add EDT instead of EST (locally), which is also 
correct. Though any given reader must know what the local %Z dst is no 
matter where povray/datetime(now) was run or where they live
compared to the person who did run it.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.