Subject: Re: Displaying current time/date
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1999/11/17
Newsgroups: comp.lang.scheme
Message-ID: <80t8ak$18fnl@fido.engr.sgi.com>
Miki Tebeka  <mtebeka@iil.intel.com> wrote:
+---------------
| > Hi, how can I display the current time and date in scheme? Is there a
| > function or a way to do that?
| 
| In MzScheme: (define d (seconds->date (current-seconds)))
| And then: (date-time d) (date-week-day d) ...
+---------------

Of course, since it's not in the standard, every implementation does it
a little differently, e.g., in Elk:

	> (unix-time->string (unix-time))
	"Tue Nov 16 19:36:13 1999\n"
	> 

or if you prefer a structured record:

	> (let ((t (unix-decode-localtime (unix-time))))
	    (list (time-year t) (time-month t) (time-day-of-month t)
		  (time-hours t) (time-minutes t) (time-seconds t)
		  (time-weekday t)
		  (time-dst t)))
	(99 10 16 19 36 13 2 0)
	> 


-Rob

-----
Rob Warnock, 8L-846		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		FAX: 650-933-0511
Mountain View, CA  94043	PP-ASEL-IA