* insert date/time
@ 2005-03-29 22:12 gooliver
2005-03-30 0:09 ` Miles Bader
[not found] ` <mailman.585.1112142448.28103.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 3+ messages in thread
From: gooliver @ 2005-03-29 22:12 UTC (permalink / raw)
I have emacs 21.3 for windows. How to insert actual date/time
in this format:
XX <Month> XXXX, <Day> - h.XX:XX
???
thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: insert date/time
2005-03-29 22:12 insert date/time gooliver
@ 2005-03-30 0:09 ` Miles Bader
[not found] ` <mailman.585.1112142448.28103.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 3+ messages in thread
From: Miles Bader @ 2005-03-30 0:09 UTC (permalink / raw)
gooliver <gooliverNOSP@Mlibero.it> writes:
> I have emacs 21.3 for windows. How to insert actual date/time
> in this format:
>
> XX <Month> XXXX, <Day> - h.XX:XX
You could define an elisp function, like:
(defun insert-wacky-time ()
(interactive)
(insert
(format-time-string "%d %B %Y, %A - h.%02H:%02M")))
And then bind it to a key, or call it using M-x. See the documentation
for `format-time-string' as to the details of the various escape
sequences.
BTW that will use the current locale's names for day/month; if you want
it to always use "standard" names, you should force format-time-string
to use the "C" locale, by binding `system-time-locale':
(defun insert-wacky-time ()
(interactive)
(let ((system-time-locale "C"))
(insert
(format-time-string "%d %B %Y, %A - h.%02H:%02M"))))
-Miles
--
Is it true that nothing can be known? If so how do we know this? -Woody Allen
^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <mailman.585.1112142448.28103.help-gnu-emacs@gnu.org>]
end of thread, other threads:[~2005-03-30 10:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-29 22:12 insert date/time gooliver
2005-03-30 0:09 ` Miles Bader
[not found] ` <mailman.585.1112142448.28103.help-gnu-emacs@gnu.org>
2005-03-30 10:57 ` gooliver
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).