Comment detail

ミリ秒まで含んだ時刻文字列 (Nested Flatten)

Squeak Smalltalk で。

#format: の引数のルールは次のようになっています。sep に 0 を渡すとセパレータなしにできるようです。

--

#(item item item sep monthFmt yearFmt twoDigits)

items: 1=day 2=month 3=year will appear in the order given, separated by sep which is eaither an ascii code or character.

monthFmt: 1=09 2=Sep 3=September

yearFmt: 1=1996 2=96

twoDigits: (missing or)1=9 2=09.

1
2
3
4
5
| yyyymmdd hhmmss xxx |
yyyymmdd := Date today printFormat: #(3 2 1 0 1 1 2).
hhmmss := Time now print24 copyWithout: $:.
xxx := Time millisecondClockValue printString last: 3.
^yyyymmdd, hhmmss, '.', xxx

× #format: の引数のルールは

○ #printFormat: の引数のルールは

Index

Feed

Other

Link

Pathtraq

loading...