How can I get the various parts of a time object? I mean something like:
> (time-hour (current-time)) 5 > (time-year (current-time)) 2012
Thanks,
--Vijay
Afficher les réponses par date
2012/1/1 Vijay Mathew mathew.vijay@gmail.com:
How can I get the various parts of a time object? I mean something like:
(time-hour (current-time))
5
(time-year (current-time))
2012
According to the documentation,
The procedure time->seconds converts the time object time into an inexact real number representing the number of seconds elapsed since the “epoch” (which is 00:00:00 Coordinated Universal Time 01-01-1970).
I guess that you'll have to implement the functions, and put them on the dumping grounds… Another approach which may be quicker to write (if you don't want to do the computations yourself) but is not portable nor precise is to call `date > somefile` with shell-command and then to read somefile…
Cheers,
P!
2012/1/2 Adrien Piérard pierarda@iro.umontreal.ca:
Another approach which may be quicker to write (if you don't want to do the computations yourself) but is not portable nor precise is to call `date > somefile` with shell-command and then to read somefile…
Or just call (with-input-from-process "date" read-line)
Cheers,
P!
There's a boost date time ffi, it does this, let me know if interested.
2012/1/1 Vijay Mathew mathew.vijay@gmail.com
How can I get the various parts of a time object? I mean something like:
(time-hour (current-time))
5
(time-year (current-time))
2012
Thanks,
--Vijay _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list