--- a/Time.st Mon Jul 19 20:53:23 1999 +0200
+++ b/Time.st Mon Jul 19 21:09:50 1999 +0200
@@ -237,6 +237,31 @@
^ '%h:%m:%s'
! !
+!Time methodsFor:'Compatibility - Squeak'!
+
+intervalString
+ "Treat the time as a difference.
+ Give it in hours and minutes with two digits of accuracy."
+
+ |hours minutes seconds hh mm ss |
+
+ hours := self hours.
+ minutes := self minutes.
+ seconds := self seconds.
+ hh := hours = 0 ifTrue: [''] ifFalse: [' ', hours printString, ' hours'].
+ mm := minutes = 0 ifTrue: [''] ifFalse: [' ', minutes printString, ' minutes'].
+ ss := seconds = 0 ifTrue: [''] ifFalse: [' ', seconds printString, ' seconds'].
+ hh size > 0 ifTrue: [ss := ''].
+ ^ hh, mm, ss
+
+ "
+ (Time fromSeconds:3600) intervalString
+ (Time fromSeconds:3605) intervalString
+ (Time fromSeconds:5) intervalString
+ (Time fromSeconds:65) intervalString
+ "
+! !
+
!Time methodsFor:'accessing'!
day
@@ -353,22 +378,6 @@
!Time methodsFor:'printing & storing'!
-intervalPrintOn:aStream
- "treat the receiver as a time delta, and
- append a user printed representation of it to aStream.
- This prints 24hour format, but without any am/pm stuff."
-
- ^ self
- printOn:aStream
- format:'%h:%m:%s'.
-
- "
- (Time fromSeconds:3600) intervalPrintOn:Transcript
- "
-
- "Modified: 22.2.1996 / 16:58:30 / cg"
-!
-
print12HourFormatOn:aStream
"append a printed representation of the receiver to aStream.
Format is hh:mm:ss am/pm (i.e. 12-hour american format)."
@@ -659,5 +668,5 @@
!Time class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Time.st,v 1.40 1999-07-19 18:53:23 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Time.st,v 1.41 1999-07-19 19:09:50 cg Exp $'
! !