Printf - equivalent package alreadyon STH or in image?
I wondered if we had something like http://www.squeaksource.com/Printf looks like generally useful for people coming from other horizons (and generally using printf formats). Phil
I started something here: http://smalltalkhub.com/#!/~dh83/c I don't remember how complete it was, but the basic printf statements worked. On 2013-10-27, at 17:51, phil@highoctane.be wrote:
I wondered if we had something like
http://www.squeaksource.com/Printf
looks like generally useful for people coming from other horizons (and generally using printf formats).
Phil
I am trying out that Printf package from SS and it is decent. e.g. 'File-%02d%02d%02d-%02d%02d.ext' printf: { now year. now month. now day. now hour. now minutes.}. I'll have a look at yours. Phil
ah nice :) I would be happy to see a fully working version! On 2013-10-27, at 17:57, phil@highoctane.be wrote:
I am trying out that Printf package from SS and it is decent.
e.g.
'File-%02d%02d%02d-%02d%02d.ext' printf: { now year. now month. now day. now hour. now minutes.}.
I'll have a look at yours.
Phil
This one works I'd say. It would be great to convert people from the C side :-) On Sun, Oct 27, 2013 at 6:09 PM, Camillo Bruni <camillobruni@gmail.com>wrote:
ah nice :) I would be happy to see a fully working version!
On 2013-10-27, at 17:57, phil@highoctane.be wrote:
I am trying out that Printf package from SS and it is decent.
e.g.
'File-%02d%02d%02d-%02d%02d.ext' printf: { now year. now month. now day. now hour. now minutes.}.
I'll have a look at yours.
Phil
Hi Phil, On 27 Oct 2013, at 17:57, phil@highoctane.be wrote:
I am trying out that Printf package from SS and it is decent.
e.g.
'File-%02d%02d%02d-%02d%02d.ext' printf: { now year. now month. now day. now hour. now minutes.}.
I'll have a look at yours.
Phil
A possible alternative is using the ZTimestampFormatter from the ZTimestamp package (see ConfigurationBrowser): 'file-{1}.ext' format: { (ZTimestampFormat fromString: '0102031605') format: TimeStamp now }. => 'file-1310272012.extâ 'file-{1}.ext' format: { (ZTimestampFormat fromString: '200102031605') format: ZTimestamp now }. => 'file-201310271913.extâ The former is local time, the latter is UTC. Sven
participants (3)
-
Camillo Bruni -
phil@highoctane.be -
Sven Van Caekenberghe