POV-Ray : Newsgroups : povray.general : Anyone use datetime? : Re: Anyone use datetime? Server Time
29 Apr 2024 14:42:15 EDT (-0400)
  Re: Anyone use datetime?  
From: Le Forgeron
Date: 20 Nov 2014 15:26:15
Message: <546e4e67$1@news.povray.org>
On 20/11/2014 21:16, Le_Forgeron wrote:
> On 20/11/2014 20:48, Leroy wrote:
>> I'm having some trouble.
>> I'm trying to have POV write datetime to a file in the form:
>>
>> // Made Wednesday 11-19-2014 07:33 PM
>>
>> Everything is fine except the hour: it was 1:33 PM
>>
>> Here what I wrote:
>> #write(Mfile,"// Made ",datetime(now,"%A %m-%d-%Y %I:%M %p"),"\n")
>>
>> The (%I) above, I got from my C++ book and don't have a C book.
>> I don't think there can be much different between them.
>> Is there something I missing, or is this a POV 3.7 bug?
> 
> datetime is from boost.

My bad, povray's datetime is using strftime(), after getting the LC_TIME
environment variable from your environment.

> 
> Your date format is not correct. '-' is for iso 8601, american's date
> should use '/'. Iso 8601 is YEAR-Month-Day (the '-' might be omitted in
> non-extended format)
> 
> There is only one format for date, Iso 8601. All other formats are doomed.
> 
> The difference of 6 hours might be due to your timezone (which you did
> not print, or its settings somewhere): give a try to "%z", "%Z" or "%ZP"
> 

Yep, "%z" or "%Z" might give you a clue about the actual clock.

If you are running something like Windows, the traditional setting of
the bios clock might be "local clock" (and that's not a good idea).

Bios clock are better as UTC clock (Never adjust them on Day-saving
change). Even better, sync them with NTP servers.


-- 
IQ of crossposters with FU: 100 / (number of groups)
IQ of crossposters without FU: 100 / (1 + number of groups)
IQ of multiposters: 100 / ( (number of groups) * (number of groups))


Post a reply to this message

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