emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problem with org-time-stamp & co
@ 2011-02-17 15:15 Michael Käufl
  2011-02-17 20:15 ` Suvayu Ali
  2011-02-18  9:17 ` Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Käufl @ 2011-02-17 15:15 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I tried to enter a date before 01/01/1970 using “C-c .” (org-time-stamp) and 
org replaced the year by 2011. (The same problem occurs with org-time-stamp-
inactive and the C-u prefixed variants.)

Although I guess that this is related to the unix time, which starts on 
01/01/1970 00:00, my lisp skills aren't good enough to let me find the 
responsible code line.


Maybe there is someone who can fix this or tell me that it's a feature, not a 
bug;)

Thanks!


-Michael


P.S. The reason I'm working with such timestamps is 
http://julien.danjou.info/org-contacts.html

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

* Re: Problem with org-time-stamp & co
  2011-02-17 15:15 Problem with org-time-stamp & co Michael Käufl
@ 2011-02-17 20:15 ` Suvayu Ali
  2011-02-18 14:42   ` Ian Barton
  2011-02-18  9:17 ` Bastien
  1 sibling, 1 reply; 5+ messages in thread
From: Suvayu Ali @ 2011-02-17 20:15 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, 17 Feb 2011 16:15:42 +0100
Michael Käufl <org-mode@lists.michael-kaeufl.de> wrote:

> Hi,
> 
> I tried to enter a date before 01/01/1970 using
> “C-c .” (org-time-stamp) and org replaced the year by 2011. (The same
> problem occurs with org-time-stamp- inactive and the C-u prefixed
> variants.)
> 
> Although I guess that this is related to the unix time, which starts
> on 01/01/1970 00:00, my lisp skills aren't good enough to let me find
> the responsible code line.
> 

I can confirm this issue with 

Org-mode version 7.4 (release_7.4.376.gfa9df.dirty)
GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of 2011-02-07

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Problem with org-time-stamp & co
  2011-02-17 15:15 Problem with org-time-stamp & co Michael Käufl
  2011-02-17 20:15 ` Suvayu Ali
@ 2011-02-18  9:17 ` Bastien
  1 sibling, 0 replies; 5+ messages in thread
From: Bastien @ 2011-02-18  9:17 UTC (permalink / raw)
  To: Michael Käufl; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 777 bytes --]

Hi Michael,

Michael Käufl <org-mode@lists.michael-kaeufl.de> writes:

> I tried to enter a date before 01/01/1970 using “C-c .” (org-time-stamp) and 
> org replaced the year by 2011. (The same problem occurs with org-time-stamp-
> inactive and the C-u prefixed variants.)
>
> Although I guess that this is related to the unix time, which starts on 
> 01/01/1970 00:00, my lisp skills aren't good enough to let me find the 
> responsible code line.
>
> Maybe there is someone who can fix this or tell me that it's a feature, not a 
> bug;)

The attached patch allows dates before 1970.  I tested it and I didn't
see any side-effect so far -- but there must a good reason why we have 
this limitation.

Carsten, could you tell where this limitation is necessary?

Thanks,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org.el.patch --]
[-- Type: text/x-patch, Size: 407 bytes --]

diff --git a/lisp/org.el b/lisp/org.el
index 655d106..bdd808d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14667,7 +14667,6 @@ user."
 	     (nth 2 tl))
 	(setq org-time-was-given t))
     (if (< year 100) (setq year (+ 2000 year)))
-    (if (< year 1970) (setq year (nth 5 defdecode))) ; not representable
     (setq org-read-date-analyze-futurep futurep)
     (list second minute hour day month year)))

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Problem with org-time-stamp & co
  2011-02-17 20:15 ` Suvayu Ali
@ 2011-02-18 14:42   ` Ian Barton
  2011-02-18 14:50     ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Barton @ 2011-02-18 14:42 UTC (permalink / raw)
  To: emacs-orgmode

On 17/02/11 20:15, Suvayu Ali wrote:
> On Thu, 17 Feb 2011 16:15:42 +0100
> Michael Käufl<org-mode@lists.michael-kaeufl.de>  wrote:
>
>> Hi,
>>
>> I tried to enter a date before 01/01/1970 using
>> “C-c .” (org-time-stamp) and org replaced the year by 2011. (The same
>> problem occurs with org-time-stamp- inactive and the C-u prefixed
>> variants.)
>>
>> Although I guess that this is related to the unix time, which starts
>> on 01/01/1970 00:00, my lisp skills aren't good enough to let me find
>> the responsible code line.
>>
>
> I can confirm this issue with
>

I found the same problem a while ago. I think the conclusion was it was 
an Emacs, rather than an org problem. I am not sure it can be fixed, but 
I would be very happy to be proved wrong!

Ian.

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

* Re: Problem with org-time-stamp & co
  2011-02-18 14:42   ` Ian Barton
@ 2011-02-18 14:50     ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2011-02-18 14:50 UTC (permalink / raw)
  To: lists; +Cc: emacs-orgmode

Hi Ian,

Ian Barton <lists@manor-farm.org> writes:

> Emacs, rather than an org problem. I am not sure it can be fixed, but I
> would be very happy to be proved wrong!

See the patch I sent this morning, which allows reading date before
1970.  I'm not applying it now, trying to figure out why this limit
was necessary.

HTH,

-- 
 Bastien

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

end of thread, other threads:[~2011-02-18 14:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-17 15:15 Problem with org-time-stamp & co Michael Käufl
2011-02-17 20:15 ` Suvayu Ali
2011-02-18 14:42   ` Ian Barton
2011-02-18 14:50     ` Bastien
2011-02-18  9:17 ` Bastien

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).