If you want to work with PLT dates instead of srfi/19 dates, I have most of the srfi/19 functions wrapped/exported for PLT dates with bzlib/date/plt.<br><br><div style="margin-left: 40px;">> (require (planet bzlib/date/plt)) <br>
> (current-date) ;; returns PLT date instead of srfi/19 date <br></div><br>However, date->string is not currently wrapped from srfi/19. But you can use bzlib/date/convert and date/plt->srfi/19 to your own date->string wrapper.<br>
<br><div style="margin-left: 40px;">> (require (prefix-in s: srfi/19) (planet bzlib/date/convert))<br>> (define (date->string date (format "~c")) ;; wrapper over srfi/19's date->string <br> (s:date->string (date/plt->srfi/19 date) format))<br>
</div><br>Then you can use the <a href="http://srfi.schemers.org/srfi-19/srfi-19.html">format string defined for SRFI/19</a> to do your formatting for plt dates. <br><br><div style="margin-left: 40px;">> (date->string (current-date) "~a, ~e ~b ~Y ~T ~z")<br>
"Mon, 28 Dec 2009 18:35:27 -0500"<br></div><br>If you just need RFC822 it is also implemented as date->rfc822<br><br><div style="margin-left: 40px;">> (date->rfc822 (current-date)) <br>"Mon, 28 Dec 2009 18:35:27 -0500"<br>
</div>
<br>You can find more usages of bzlib/date at <a href="http://weblambda.blogspot.com/2009/10/bzlibdate-bzlibdate-tz-02-now-available.html">http://weblambda.blogspot.com/2009/10/bzlibdate-bzlibdate-tz-02-now-available.html</a> - let me know if there are any questions/issues/comments.<br>
<br>Cheers,<br>yc<br><br><div class="gmail_quote">On Mon, Dec 28, 2009 at 2:49 PM, David Brown <span dir="ltr"><<a href="mailto:plt@davidb.org">plt@davidb.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Mon, Dec 28, 2009 at 09:04:07PM +0000, Daniel Bastos wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I miss a PLT function such as strftime. I can't find anything like it,<br>
in the reference, and on the web. I would like to easily produce a<br>
string such as ``Mon Dec 28 21:56:33 CET 2009.'' The closest to it to<br>
choose the format of 'rfc2822.<br>
</blockquote>
<br></div>
srfi/19 has a date->string converter, however it wants an srfi/19 date<br>
instead of the PLT date. If you don't need to convert between them,<br>
it's fairly easy, otherwise, you'd have to figure out if the julian<br>
conversions are the same and convert between them.<br><font color="#888888">
<br>
David</font><div><div></div><div class="h5"><br>
_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
</div></div></blockquote></div><br>