all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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

* Re: insert date/time
       [not found] ` <mailman.585.1112142448.28103.help-gnu-emacs@gnu.org>
@ 2005-03-30 10:57   ` gooliver
  0 siblings, 0 replies; 3+ messages in thread
From: gooliver @ 2005-03-30 10:57 UTC (permalink / raw)


>         (format-time-string "%d %B %Y, %A - h.%02H:%02M"))))

thanks for tip... how to get up-cased (only) the first letter of %B ???
%^B up-case all word!

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

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

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.