Improved encoding for creation date, that can be used as uid.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-07-23 13:43:37 -05:00
parent c14e40152e
commit eef18e1387
1 changed files with 18 additions and 0 deletions

View File

@ -119,6 +119,24 @@ Tiddler >> 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 }
Tiddler >> creator [