Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: ken <ken@cleveland.lug.net>
Cc: <help-gnu-emacs@gnu.org>
Subject: Re: inserting date and time at the cursor location
Date: Fri, 4 Oct 2002 00:46:41 -0400	[thread overview]
Message-ID: <Pine.LNX.4.33.0210040033400.1963-100000__47488.5795185857$1138668080$gmane$org@heidegger.mousecar.net> (raw)
In-Reply-To: <3d9aee7f$0$15412$3b214f66@aconews.univie.ac.at>


Here's some elisp which does them separately... what I use:

(defun now ()
  "Insert string for the current time formatted like '2:34 PM'."
  (interactive)                 ; permit invocation in minibuffer
  (insert (format-time-string "%-I:%M %p"))
)


(defun today ()
  "Insert string for today's date nicely formatted in American style,
e.g. Sunday, September 17, 2000."
  (interactive)                 ; permit invocation in minibuffer
  (insert (format-time-string "%A, %B %e, %Y"))
)

Put these in a file in your emacs path.  Do "M-x today" or "M-x now" to 
invoke.  Also, it should be obvious how to integrate the two.


hth,
ken

-- 
AMD crashes?  See http://cleveland.lug.net/~ken/amd-problem/.

Spake Guy-Armand Kamendje at 15:03 (UTC+0200) on Wed, 2 Oct 2002:

= Hi,
= Is there a way to let xemacs insert the current date and time at the actual
= cursor location?
= Thanks for any hint
= Guy
= 
= 
= _______________________________________________
= Help-gnu-emacs mailing list
= Help-gnu-emacs@gnu.org
= http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
= 


  parent reply	other threads:[~2002-10-04  4:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3d9aee7f$0$15412$3b214f66@aconews.univie.ac.at>
2002-10-02 15:10 ` Josh Huber
     [not found] ` <m33croeu49.fsf@defun.localdomain>
2002-10-02 15:37   ` David Kastrup
     [not found]   ` <x5fzvoam2w.fsf@tupik.goethe.zz>
     [not found]     ` <65wkkzdz.fsf@ID-23066.news.dfncis.de>
2002-10-11 12:14       ` Mario Lang
2002-10-04  4:46 ` ken [this message]
2002-10-02 13:03 Guy-Armand Kamendje

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='Pine.LNX.4.33.0210040033400.1963-100000__47488.5795185857$1138668080$gmane$org@heidegger.mousecar.net' \
    --to=ken@cleveland.lug.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).