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:
Kernel-Chronology
Version:
rev: 1.6 date: 2023/06/06 16:06:06
user: cg
file: TimePeriod.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


This class represents time periods defined by start and endtime.
It is used to represent ISO8601 timeperiods.

copyright

COPYRIGHT (c) 2018 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

instance creation
o  startTime: startTimeArg endTime: endTimeArg

ui support
o  iconInBrowserSymbol
the browser will use this as index into the toolbariconlibrary


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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:41:45 GMT