All time-of-day classes (Hour to Fraction) takes unix time as argument. I think I made an attempt to create anything from unixtime, but I forgot how it worked. Is it important?
Calendar.now() creates a Fraction, which is a nanosecond in precision.
/ Mirar
Previous text:
2003-06-01 23:37: Subject: Re: Pike Cookbook
got anything for that yet?
everytime i spend considerably more time researching how to solve something, then the length of the solution should warant, then the solution deserves to be written down somehwere:
problem: turn time() into an SMTP Date: string
solution: Calendar.now()->format_smtp();
this one was easy, but i actually needed to make a function string get_time(int t); that would take time as an argument.
solution:
string get_time(int t) { return Calendar.Second(t)->format_smtp(); }
now this one took considerably longer to find. as it is absolutely not clear that Second is the only class to take unix time as an argument. (or is it?)
are there other solutions?
greetings, martin.
/ Brevbäraren