> On Nov 21, 2017, at 1:23 PM, Karim Chellaoui <[email protected]> wrote: > > I'm still new to Pollen so excuse me if I missed the information but I'm > getting quite lost in the documentation... > My goal is to write a date as version number, for today I would like it to be > "20171121" for instance. How can I best achieve this? > I see that there is a Time racket package > https://docs.racket-lang.org/reference/time.html > <https://docs.racket-lang.org/reference/time.html> but it's unclear to me how > I can call it.
The `gregor` library has the better time & date tools. Assuming you want the date stamp to be consistently eight digits, you could use `~t` with a CLDR pattern: [1] (require gregor) (~t (now) "yyyyMMdd") The code below is maybe more obvious, but doesn't work, because one-digit days and months won't be padded to two digits: (require racket/date) (define d (current-date)) (format "~a~a~a" (date-year d) (date-month d) (date-day d)) [1] http://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table <http://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table> -- You received this message because you are subscribed to the Google Groups "Pollen" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
