emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-read-date wrong for dates before 1970 ?
@ 2015-09-17  9:18 Martin Kaffanke
  2015-09-17  9:28 ` Nicolas Goaziou
  2015-09-17  9:48 ` Eric S Fraga
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Kaffanke @ 2015-09-17  9:18 UTC (permalink / raw)
  To: emacs-orgmode


Hi there,

I'm doing in *scratch* the following (with C-j at the end of the line):

(org-insert-time-stamp (org-read-date nil 'totime "8. März 2012"))
<2012-10-08 Mon>"<2012-10-08 Mon>"

(org-insert-time-stamp (org-read-date nil 'totime "8. März 1952"))
<1970-10-08 Don>"<1970-10-08 Don>"

(org-insert-time-stamp (org-read-date nil 'totime "1952-03-08"))
<1970-03-08 Son>"<1970-03-08 Son>"

So there a (german, and english - the last one) formated time is
translated correct for dates after 1970, but its wrong before that.

How can we fix that?

(this code is used in the google-contacts-to-org-contacts functions from
the google-contacts package)

Thanks,
Martin

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

* Re: org-read-date wrong for dates before 1970 ?
  2015-09-17  9:18 org-read-date wrong for dates before 1970 ? Martin Kaffanke
@ 2015-09-17  9:28 ` Nicolas Goaziou
  2015-09-17  9:46   ` Martin Kaffanke
  2015-09-17  9:48 ` Eric S Fraga
  1 sibling, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2015-09-17  9:28 UTC (permalink / raw)
  To: Martin Kaffanke; +Cc: emacs-orgmode

Hello,

Martin Kaffanke <martin@kaffanke.at> writes:

> I'm doing in *scratch* the following (with C-j at the end of the line):
>
> (org-insert-time-stamp (org-read-date nil 'totime "8. März 2012"))
> <2012-10-08 Mon>"<2012-10-08 Mon>"
>
> (org-insert-time-stamp (org-read-date nil 'totime "8. März 1952"))
> <1970-10-08 Don>"<1970-10-08 Don>"
>
> (org-insert-time-stamp (org-read-date nil 'totime "1952-03-08"))
> <1970-03-08 Son>"<1970-03-08 Son>"
>
> So there a (german, and english - the last one) formated time is
> translated correct for dates after 1970, but its wrong before that.
>
> How can we fix that?

See org-read-date-force-compatible-dates.

Regards,

-- 
Nicolas Goaziou

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

* Re: org-read-date wrong for dates before 1970 ?
  2015-09-17  9:28 ` Nicolas Goaziou
@ 2015-09-17  9:46   ` Martin Kaffanke
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Kaffanke @ 2015-09-17  9:46 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou writes:

> Hello,
>
> Martin Kaffanke <martin@kaffanke.at> writes:
>
>> So there a (german, and english - the last one) formated time is
>> translated correct for dates after 1970, but its wrong before that.
>>
>> How can we fix that?
>
> See org-read-date-force-compatible-dates.

Thanks, that's the important hint.  Even if I think this solution is for
stability by having less functionality.  So maybe there should be found
a stable solution with full functionality?

Thanks,
Martin

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

* Re: org-read-date wrong for dates before 1970 ?
  2015-09-17  9:18 org-read-date wrong for dates before 1970 ? Martin Kaffanke
  2015-09-17  9:28 ` Nicolas Goaziou
@ 2015-09-17  9:48 ` Eric S Fraga
  1 sibling, 0 replies; 4+ messages in thread
From: Eric S Fraga @ 2015-09-17  9:48 UTC (permalink / raw)
  To: Martin Kaffanke; +Cc: emacs-orgmode

On Thursday, 17 Sep 2015 at 11:18, Martin Kaffanke wrote:

[...]

> So there a (german, and english - the last one) formated time is
> translated correct for dates after 1970, but its wrong before that.

This is a known issue: Unix was born in 1969 and time did not exist
before ;-)  It's the equivalent of the big bang.

More seriously, the data structure used to indicate time and date in
Unix is 0 sometime in 1969 and runs out in 2037 (due to 32 bit integer
arithmetic), at least as far as org is concerned.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.1-234-g8c85c9

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

end of thread, other threads:[~2015-09-17  9:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-17  9:18 org-read-date wrong for dates before 1970 ? Martin Kaffanke
2015-09-17  9:28 ` Nicolas Goaziou
2015-09-17  9:46   ` Martin Kaffanke
2015-09-17  9:48 ` Eric S Fraga

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).