🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by mizu Tue, 30 Jan 2001 13:03
日付のスタンプ
#110
Author: mizu
Date: Tue, 30 Jan 2001 13:03
19 lines
1480 bytes
はじめて投稿するMIZUと申します。

Mule for Windowsの.emacsに

(defun insert-current-time ()
  (interactive)
  (insert (current-time-string)))

と書き込み、実行すると、

Tue Jan 30 21:56:07 2001

のように、表示されます。これを、

21:56 Tue 30 Jan 2001

のように表示させたい場合、どのようにLISPを組めば
よいのでしょうか?
 初歩的な質問で恐縮ですが、どなたかご教示ください。
Re: 日付のスタンプ
#111
Author: NODA Takashi
Date: Tue, 30 Jan 2001 15:01
35 lines
2063 bytes
mizu <mizu@ask.ne.jp> writes:
> (defun insert-current-time ()
>   (interactive)
>   (insert (current-time-string)))
> 
> と書き込み、実行すると、
> 
> Tue Jan 30 21:56:07 2001
> 
> のように、表示されます。これを、
> 
> 21:56 Tue 30 Jan 2001
> 
> のように表示させたい場合、どのようにLISPを組めば
> よいのでしょうか?

私も調べてみようと思いたち、
まず
(describe-function 'current-time-string)
したあとに
(describe-function 'format-time-string)
したら

(defun insert-current-time ()
   (interactive)
   (insert (format-time-string "%R %a %d %b %Y")))
を導くことができました。

current-time-string という Keyword があったので所要時間は
3分かかりませんでした。

# わからないものはすぐ describe-{function,variable} しちゃう。

▼△ のだたかし (NODA Takashi)
▽▲ mailto:noda@mb.neweb.ne.jp
Re: 日付のスタンプ
#112
Author: mizu
Date: Wed, 31 Jan 2001 14:16
39 lines
2159 bytes
レスが遅れてしまいました。

 早速試してみたいと思います。まずはありがとうございます。

>> mizu <mizu@ask.ne.jp> writes:
> > (defun insert-current-time ()
> >   (interactive)
> >   (insert (current-time-string)))
> >
> > と書き込み、実行すると、
> >
> > Tue Jan 30 21:56:07 2001
> >
> > のように、表示されます。これを、
> >
> > 21:56 Tue 30 Jan 2001
> >
> > のように表示させたい場合、どのようにLISPを組めば
> > よいのでしょうか?
> 
> 私も調べてみようと思いたち、
> まず
> (describe-function 'current-time-string)
> したあとに
> (describe-function 'format-time-string)
> したら
> 
> (defun insert-current-time ()
>    (interactive)
>    (insert (format-time-string "%R %a %d %b %Y")))
> を導くことができました。
> 
> current-time-string という Keyword があったので所要時間は
> 3分かかりませんでした。
> 
> # わからないものはすぐ describe-{function,variable} しちゃう。
> 
> ▼△ のだたかし (NODA Takashi)
> ▽▲ mailto:noda@mb.neweb.ne.jp
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads