[Pharo-users] Formatting Dates

Eduardo de Oliveira Padoan eduardo.padoan at gmail.com
Thu Feb 7 13:56:23 EST 2019


Seems like the method it ends up using, Date>>printDate:format:on:,
currently ignores the formatArray given and just prints using YYYY-MM-DD.

But there's a ExrendedDatePrinter class that implements the same method and
does what you expect.

I found it using ctrl-m when selecting the expression and looking at the
implementations, but I haven't used it to be sure.

On Wed, Feb 6, 2019 at 6:17 PM sergio ruiz <sergio.rrd at gmail.com> wrote:

> I have been using this to format dates:
>
> printFormat: #(3 2 1 $/ 1 1 2)
>
> which goes like:
>
> printFormat: formatArray
> "Answer a String describing the receiver using the argument formatArray."
>
> ^ String
> new: 16
> streamContents: [ :aStream | self printOn: aStream format: formatArray ]
>
> But i am unclear on how to assemble this formatArray to get a date like:
>
> mm/dd/yyyy
>
> any ideas?
>
> Thanks!
>
> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
>


-- 
 Eduardo de Oliveira Padoan ⋮)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20190207/dea0c6f1/attachment.html>


More information about the Pharo-users mailing list