From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: ack94598@yahoo.com (') Newsgroups: gmane.emacs.help Subject: Re: how to insert a timestamp? Date: 7 Jan 2004 23:43:24 -0800 Organization: http://groups.google.com Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <45b780c3.0401072343.6845a6bd@posting.google.com> References: <45b780c3.0401061312.40351c46@posting.google.com> NNTP-Posting-Host: deer.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1073547932 1689 80.91.224.253 (8 Jan 2004 07:45:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Jan 2004 07:45:32 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 08 08:45:26 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AeUr7-0001gb-01 for ; Thu, 08 Jan 2004 08:45:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AeVnL-00036E-P4 for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Jan 2004 03:45:35 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: 66.234.215.26 Original-X-Trace: posting.google.com 1073547806 5368 127.0.0.1 (8 Jan 2004 07:43:26 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 8 Jan 2004 07:43:26 +0000 (UTC) Original-Xref: shelby.stanford.edu gnu.emacs.help:119861 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:15804 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15804 Thanks for your help! I had never actually written an Emacs Lisp function before, but with this handy link: http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/index.html I was able to quickly produce the following: (defun timestamp () "Insert timestamp at point." (interactive) (insert (format-time-string "%a, %d %b %Y %H:%M:%S %z"))) (global-set-key [f5] 'timestamp) I love it! Emacs rocks! Adam Benjamin Rutt wrote in message news:... > ack94598@yahoo.com (') writes: > > > How can I insert a string representing the current time/date at the > > point? It is for timestamping entries in a diary/log. > > I use: > > (insert (format-time-string "%a %b %e, %Y %l:%M %p")) > > which gives (ATM): Tue Jan 6, 2004 4:15 PM > > There are a zillion other ways to do it. See C-h f > format-time-string.