9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] quick tmdate question
@ 2021-09-30 15:05 lyndsay
  2021-10-01  1:54 ` Kurt H Maier
  2021-10-01  5:15 ` ori
  0 siblings, 2 replies; 4+ messages in thread
From: lyndsay @ 2021-09-30 15:05 UTC (permalink / raw)
  To: 9front

can't find a clear answer in tmdate(2)=C2=A0 - i'm writing a program (in =
c)=20
that needs a way to store and parse any arbitrary time AD. will those be=20
properly dealt with if i store times in Tm and parse user input with=20
tmparse() or should i write my own function?

-lyndsay


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9front] quick tmdate question
  2021-09-30 15:05 [9front] quick tmdate question lyndsay
@ 2021-10-01  1:54 ` Kurt H Maier
  2021-10-01  5:15 ` ori
  1 sibling, 0 replies; 4+ messages in thread
From: Kurt H Maier @ 2021-10-01  1:54 UTC (permalink / raw)
  To: 9front

On Thu, Sep 30, 2021 at 09:05:33AM -0600, lyndsay wrote:
> can't find a clear answer in tmdate(2)� - i'm writing a program (in c) 
> that needs a way to store and parse any arbitrary time AD. will those be 
> properly dealt with if i store times in Tm and parse user input with 
> tmparse() or should i write my own function?
> 
> -lyndsay
> 

Steal code from /sys/src/cmd/seconds.c is my advice


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9front] quick tmdate question
  2021-09-30 15:05 [9front] quick tmdate question lyndsay
  2021-10-01  1:54 ` Kurt H Maier
@ 2021-10-01  5:15 ` ori
  2021-10-01 14:24   ` lyndsay
  1 sibling, 1 reply; 4+ messages in thread
From: ori @ 2021-10-01  5:15 UTC (permalink / raw)
  To: 9front

Quoth lyndsay <lyndsay@vivaldi.net>:
> can't find a clear answer in tmdate(2)  - i'm writing a program (in c) 
> that needs a way to store and parse any arbitrary time AD. will those be 
> properly dealt with if i store times in Tm and parse user input with 
> tmparse() or should i write my own function?

If the proleptic gregorian calendar is enough, then
tmdate should work for you.  It does not handle the
(locale-specific!) calendar changeovers.  Our timezone
information simply doesn't encode calendar changes.

I'm not even sure if the IANA timezone database encodes
calendar changes.

I'd suggest using the proleptic gregorian calendar, and
converting from it as late as possible.  Ideally never.

https://en.wikipedia.org/wiki/List_of_adoption_dates_of_the_Gregorian_calendar_by_country


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9front] quick tmdate question
  2021-10-01  5:15 ` ori
@ 2021-10-01 14:24   ` lyndsay
  0 siblings, 0 replies; 4+ messages in thread
From: lyndsay @ 2021-10-01 14:24 UTC (permalink / raw)
  To: 9front

awesome, that should be fine for me; all of the times being processed=20
have to be put in by the user and the users probably won't want to use a=20
calendar other than gregorian so almost all input, even before 1582,=20
would probably end up being in proleptic gregorian format anyway. at=20
least, that's what the mathematical equations i put in are assuming!=20
i'll also put a note in the help and manual for the software juuuust to=20
make sure.

thanks!

lyndsay

On 9/30/21 23:15, ori@eigenstate.org wrote:
> Quoth lyndsay <lyndsay@vivaldi.net>:
>> can't find a clear answer in tmdate(2)=C2=A0 - i'm writing a program (=
in c)
>> that needs a way to store and parse any arbitrary time AD. will those =
be
>> properly dealt with if i store times in Tm and parse user input with
>> tmparse() or should i write my own function?
> If the proleptic gregorian calendar is enough, then
> tmdate should work for you.  It does not handle the
> (locale-specific!) calendar changeovers.  Our timezone
> information simply doesn't encode calendar changes.
>
> I'm not even sure if the IANA timezone database encodes
> calendar changes.
>
> I'd suggest using the proleptic gregorian calendar, and
> converting from it as late as possible.  Ideally never.
>
> https://en.wikipedia.org/wiki/List_of_adoption_dates_of_the_Gregorian_c=
alendar_by_country
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-02  9:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 15:05 [9front] quick tmdate question lyndsay
2021-10-01  1:54 ` Kurt H Maier
2021-10-01  5:15 ` ori
2021-10-01 14:24   ` lyndsay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).