unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Display current date/time
@ 2014-03-25  9:54 Marcin Borkowski
  2014-03-25 10:15 ` Thibaut Verron
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Marcin Borkowski @ 2014-03-25  9:54 UTC (permalink / raw)
  To: GNU Emacs users list

Hello list,

is there an (interactive) function to display current date and/or time
in the echo area?  I'd like to be able to say M-x today and see today's
date, for instance, without having to fire up the calendar.

TIA,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



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

* Re: Display current date/time
       [not found] <mailman.18141.1395741262.10748.help-gnu-emacs@gnu.org>
@ 2014-03-25 10:10 ` Damien Wyart
  0 siblings, 0 replies; 6+ messages in thread
From: Damien Wyart @ 2014-03-25 10:10 UTC (permalink / raw)
  To: help-gnu-emacs

* Marcin Borkowski <mbork@wmi.amu.edu.pl> in gnu.emacs.help:
> is there an (interactive) function to display current date and/or time
> in the echo area? I'd like to be able to say M-x today and see today's
> date, for instance, without having to fire up the calendar.

You can find several solutions there:
http://stackoverflow.com/questions/251908/how-can-i-insert-current-date-and-time-into-a-file-using-emacs
(to insert in the current buffer, but it is easy to adapt them for the
echo area).

-- 
DW


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

* Re: Display current date/time
  2014-03-25  9:54 Display current date/time Marcin Borkowski
@ 2014-03-25 10:15 ` Thibaut Verron
  2014-03-25 12:05 ` Eric Abrahamsen
  2014-03-25 21:37 ` Stefan Monnier
  2 siblings, 0 replies; 6+ messages in thread
From: Thibaut Verron @ 2014-03-25 10:15 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski <mbork <at> wmi.amu.edu.pl> writes:

> 
> Hello list,
> 
> is there an (interactive) function to display current date and/or time
> in the echo area?  I'd like to be able to say M-x today and see today's
> date, for instance, without having to fire up the calendar.
> 
> TIA,
> 

I don't know of any existing function for that, but you can use a simple 
definition like:

(defun today ()
(interactive)
(message (format-time-string "%Y-%m-%d %T")))

Thibaut




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

* Re: Display current date/time
  2014-03-25  9:54 Display current date/time Marcin Borkowski
  2014-03-25 10:15 ` Thibaut Verron
@ 2014-03-25 12:05 ` Eric Abrahamsen
  2014-03-25 21:37 ` Stefan Monnier
  2 siblings, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2014-03-25 12:05 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Hello list,
>
> is there an (interactive) function to display current date and/or time
> in the echo area?  I'd like to be able to say M-x today and see today's
> date, for instance, without having to fire up the calendar.
>
> TIA,

You can also use (display-time-mode 1) in your init file to have it
always in the mode line.




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

* Re: Display current date/time
  2014-03-25  9:54 Display current date/time Marcin Borkowski
  2014-03-25 10:15 ` Thibaut Verron
  2014-03-25 12:05 ` Eric Abrahamsen
@ 2014-03-25 21:37 ` Stefan Monnier
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2014-03-25 21:37 UTC (permalink / raw)
  To: help-gnu-emacs

> is there an (interactive) function to display current date and/or time
> in the echo area?  I'd like to be able to say M-x today and see today's
> date, for instance, without having to fire up the calendar.

M-! date RET

It's not M-x but close enough, I think,


        Stefan




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

* Re: Display current date/time
@ 2014-03-27  0:35 Tak Kunihiro
  0 siblings, 0 replies; 6+ messages in thread
From: Tak Kunihiro @ 2014-03-27  0:35 UTC (permalink / raw)
  To: mbork, help-gnu-emacs; +Cc: tkk

I use yasnippet to see current date/time.
Snippets with key `today/now' insert date/time in current buffer.

# name: (today)
# key: today
# --
`(format-time-string "%B %e, %Y (%a)" (current-time))`

# name: (now)
# key: now
# --
`(format-time-string "%T %Z" (current-time))`


> Hello list,
> 
> is there an (interactive) function to display current date and/or time
> in the echo area?  I'd like to be able to say M-x today and see today's
> date, for instance, without having to fire up the calendar.
> 
> TIA,



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

end of thread, other threads:[~2014-03-27  0:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-25  9:54 Display current date/time Marcin Borkowski
2014-03-25 10:15 ` Thibaut Verron
2014-03-25 12:05 ` Eric Abrahamsen
2014-03-25 21:37 ` Stefan Monnier
     [not found] <mailman.18141.1395741262.10748.help-gnu-emacs@gnu.org>
2014-03-25 10:10 ` Damien Wyart
  -- strict thread matches above, loose matches on Subject: below --
2014-03-27  0:35 Tak Kunihiro

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).