#BUGFIX by mawalch
class: AbstractTime
added: #differenceFromTimestamp:
Re-add.
--- a/AbstractTime.st Mon Mar 19 11:31:18 2018 +0100
+++ b/AbstractTime.st Mon Mar 19 12:50:49 2018 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1995 by Claus Gittinger
All Rights Reserved
@@ -608,6 +606,7 @@
"
! !
+
!AbstractTime methodsFor:'abstract'!
hours
@@ -1154,6 +1153,23 @@
^ self subclassResponsibility
! !
+!AbstractTime methodsFor:'double dispatching'!
+
+differenceFromTimestamp:aTimestamp
+ "/ the correct thing to do (and I will, in the future) is to
+ "/ return a TimeDuration:
+ "/
+ ^ TimeDuration fromMilliseconds:(aTimestamp getMilliseconds - self getMilliseconds).
+
+ "/ which is the same as: deltaFrom:aTimestamp
+ "/
+ "/ however, there might be old code around, which is not be prepared for
+ "/ getting a non-number (the seconds). Therefore, for the meantime,
+ "/ we return:
+
+ "/ ^ aTimestamp getSeconds - self getSeconds
+! !
+
!AbstractTime methodsFor:'printing & storing'!