bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#311: marked as done (parse-time-string fails on non-abbre month str


From: Emacs bug Tracking System
Subject: bug#311: marked as done (parse-time-string fails on non-abbre month str)
Date: Mon, 26 May 2008 20:55:07 -0700

Your message dated Mon, 26 May 2008 23:47:31 -0400
with message-id <87hcckbe7g.fsf@stupidchicken.com>
and subject line parse-time-string fails on non-abbre month str
has caused the Emacs bug report #311,
regarding parse-time-string fails on non-abbre month str
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
311: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=311
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems
--- Begin Message --- Subject: parse-time-string fails on non-abbre month str Date: Fri, 23 May 2008 15:32:45 -0700

This fails in getting the month string.
(parse-time-string "August 5, 2002.")

Kevin Rodgers also reported in gnu.emacs.help yesterday that it fails in getting full weekday names, and he provide a fix for that. (his message and code pasted below my sig)

  Xah
  xah@xahlee.org
∑ http://xahlee.org/

☄

Newsgroups: gnu.emacs.help
From: Kevin Rodgers <kevin.d.rodg...@gmail.com>
Date: Thu, 22 May 2008 22:17:49 -0600
Local: Thurs, May 22 2008 9:17 pm
Subject: Re: parsing time stamp

Johan Bockgård wrote:
> Xah <xah...@gmail.com> writes:
>> is there a function that parses a timestamp like “Monday, Nov. 28,
>> 1994” so that i can write a function to turn it into the format yyyy-
>> mm-dd?
> parse-time-string


(parse-time-string "Monday, Nov. 28, 1994")
=> (nil nil nil 28 11 1994 nil nil nil)
Odd that the leading "Monday, " yields nil DOW...  It turns out that is
due to the fact that the parse-time-weekdays variable only has
abbreviations (e.g. "mon"), just like parse-time-months.  Easy to fix:
(let ((parse-time-weekdays (append parse-time-weekdays
                                   '(("sunday" . 0)
                                     ("monday" . 1)
                                     ("tuesday" . 2)
                                     ("wednesday" . 3)
                                     ("thursday" . 4)
                                     ("friday" . 5)
                                     ("saturday" . 6)))))
   (parse-time-string "Monday, Nov. 28, 1994"))
=> (nil nil nil 28 11 1994 1 nil nil)
--
Kevin Rodgers
Denver, Colorado, USA


☄







--- End Message ---
--- Begin Message --- Subject: parse-time-string fails on non-abbre month str Date: Mon, 26 May 2008 23:47:31 -0400
> This fails in getting the month string.
> (parse-time-string "August 5, 2002.")

I've fixed this in CVS.  Thanks.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]