all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* parsing a date
@ 2012-09-28  2:07 Eric Abrahamsen
  2012-09-28  2:50 ` Óscar Fuentes
       [not found] ` <mailman.9886.1348800663.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 13+ messages in thread
From: Eric Abrahamsen @ 2012-09-28  2:07 UTC (permalink / raw)
  To: help-gnu-emacs

I'm reading in files with dates in this format: "2011-11-25". I need to
write them out as "2011/11/25". Instead of just manhandling the strings
(I'll likely need this date information in other places) I wanted to
parse the strings into proper date objects, then format them back into
strings. `date-to-time' doesn't work because (parse-time-string
"2011-11-15") gives me:

(nil nil nil 15 11 2011 nil nil nil)

Which is not acceptable to `encode-time', because it requires integers,
not nil. I can't believe this is quite this complicated: do I really
have to replace all the nils with 0 myself?

Any pointers gratefully accepted,

Eric

-- 
GNU Emacs 24.2.50.1 (i686-pc-linux-gnu, GTK+ Version 3.4.4)
 of 2012-09-16 on pellet




^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <mailman.9885.1348798043.855.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2012-12-24  3:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28  2:07 parsing a date Eric Abrahamsen
2012-09-28  2:50 ` Óscar Fuentes
2012-09-28  3:20   ` Eric Abrahamsen
2012-09-28  4:14     ` Óscar Fuentes
2012-09-28  6:11       ` Eric Abrahamsen
     [not found]       ` <mailman.9889.1348812706.855.help-gnu-emacs@gnu.org>
2012-10-14  1:51         ` David Combs
2012-10-14  7:18           ` Eric Abrahamsen
     [not found] ` <mailman.9886.1348800663.855.help-gnu-emacs@gnu.org>
2012-09-29 17:00   ` Stefan Monnier
     [not found] <mailman.9885.1348798043.855.help-gnu-emacs@gnu.org>
2012-12-02  7:25 ` WJ
2012-12-23  5:55   ` Eric Abrahamsen
2012-12-24  0:39     ` ken
2012-12-24  3:02       ` Eric Abrahamsen
2012-12-24  3:54         ` ken

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.