eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'TimePeriod':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: TimePeriod


Inheritance:

   Object
   |
   +--TimePeriod

Package:
stx:libbasic
Category:
Magnitude-Time
Version:
rev: 1.1 date: 2018/05/10 19:03:11
user: cg
file: TimePeriod.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


This class represents time periods defined by start and endtime.
It will be as a representation of ISO8601 timeperiods.


Class protocol:

instance creation
o  startTime: startTimeArg endTime: endTimeArg


Instance protocol:

accessing
o  endTime

o  endTime: aTimeOrDate

o  startTime

o  startTime: aTimeOrDate

o  startTime: startTimeArg endTime: endTimeArg

queries
o  duration
return the difference between end- and starttime

usage example(s):

     (TimePeriod startTime:(Date today) endTime:(Date tomorrow)) duration   -> 1d
     (TimePeriod startTime:(Time now) endTime:(Date tomorrow)) duration     -> rest duration till tomorrow
     (TimePeriod startTime:(Timestamp now) endTime:(Timestamp fromString:'2050-01-01')) duration


Examples:


     |p|
     p := TimePeriod startTime:(Date today) endTime:(Date tomorrow).
     p duration 
     |p|
     p := TimePeriod startTime:(Time now) endTime:(Date tomorrow).
     p duration 
     |p|
     p := TimePeriod startTime:(Timestamp now) endTime:(Timestamp fromString:'2050-01-01').
     p duration


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sat, 20 Apr 2024 05:33:31 GMT