Menu

#18 [Fix] asTimeStamp on Squeak

open
nobody
None
5
2006-06-22
2006-06-22
No

Squeak uses the method asTimeStamp instead of
asTimestamp so ...

adding the method

Dialect class>>timeStampFrom: anObject
"squeak uses the method asTimeStamp! "
self isSqueak ifTrue: [^anObject asTimeStamp].
^anObject asTimestamp.

and changing

DatabasePlatform>>readTimestamp: anObject for: aType
"Seems like we get to do this ourselves, in a
lowest common denominator kind of way. Translate into
GMT if we've got a timezone."

"assumes ISO format.
self readTimestamp: '2003-03-03 15:29:28.337-
05' for: nil.
self readTimestamp: '2003-03-03 19:29:28.337-
05' for: nil"

anObject isNil ifTrue: [^nil].
anObject class == Dialect timestampClass
ifTrue: [^anObject].
anObject isString
ifTrue:
[| stream |
stream _ ReadStream on:
anObject.
^self
readTimestampFromStream: stream for: aType].
^Dialect timeStampFrom: anObject

to call this method at the end fixes the problem.

(see bug for fixing isSqueak for 3.9)

Ron Teitelbaum
Ron@USMedRec.com

Discussion


Log in to post a comment.