Re: can I get support for 'current-time under slib

From: David Tillman <>
Date: Wed, 16 May 2001 09:07:04 -0500

> Firstly, thanks very much to Erick. I received a patch for my grid
> geometry manager problem, and all is well!
> I need to do some time stuff. I've installed slib, but (provided?
> 'current-time) -> #f, so I'm out of luck...
> Does anyone have any suggestions ?
> (I haven't looked at STklos...but I need the sockets in STk..)
> cheers and thanks VERY much!
> chris

  I'm not sure what current-time under slib does - however,
  this is what I use for the real-world time in STk:

(define unix-date
  (lambda (args)
    (let ((proc (run-process "/bin/date" args :output :pipe)))
      (read-line (process-output proc)))))

  Obviously, location of the date command may be different on your system.

  This gets you:

STk> (unix-date "+%s")
STk> (unix-date "+%H:%M:%S")
STk> (unix-date "+%A, %B %d, %Y")
"Wednesday, May 16, 2001"

  Etc. I hope this helps. I suppose this is a bit inefficient to spawn
  a process each time I want the date. If I was really concerned, I would
  use the FFI.


David Tillman                      |  System Administrator  |  Ozark Aircraft Systems
Received on Wed May 16 2001 - 16:07:53 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST