Improved encoding for creation date, that can be used as uid.
This commit is contained in:
parent
c14e40152e
commit
eef18e1387
@ -119,6 +119,24 @@ Tiddler >> created: anObject [
|
|||||||
created := anObject
|
created := anObject
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
Tiddler >> createdAsTWFormat [
|
||||||
|
^ ((ZTimestampFormat fromString: '20010203160506700')
|
||||||
|
format: (ZTimestamp fromString: self created)) copyFrom: 1 to: 17
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
Tiddler >> createdEncoded [
|
||||||
|
| output longDate |
|
||||||
|
longDate := self createdAsTWFormat.
|
||||||
|
output := '' writeStream.
|
||||||
|
1 to: 14 by: 2 do: [ :i |
|
||||||
|
output nextPutAll: (longDate copyFrom: i to: i +1 ) asInteger asCharacterDigit asString
|
||||||
|
].
|
||||||
|
output nextPutAll: ((longDate copyFrom: 15 to: 17)).
|
||||||
|
^ output contents
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
Tiddler >> creator [
|
Tiddler >> creator [
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user