Time representation


Section contents


Overview

Defined in

ce32base.oxh

Description

<TBS>


Construction / destruction


NewTime - Constructor

Usage

this& = NewTime&:

Description

Creates a time object and returns a handle which allows the object to be manipulated.

Parameters
width& The width of the size.
height& The height of the size
Return Value
this& An value which represents the created time
Error Handling

If the object could not be created then an error is generated which should be trapped by an ONERR handler.

Example
  LOCAL this&

  this& = NewTime&:
  DeleteTime:(this&) 

NewTime2 - Constructor

Usage

this& = NewTime2&:(int64&)

Description

Creates a time object, initialises with the int64 object int64& and returns a handle which allows the object to be manipulated.

Parameters
int64& A handle to an int64 object
Return Value
this& An value which represents the created time
Error Handling

If the object could not be created then an error is generated which should be trapped by an ONERR handler.


NewTime3 - Constructor

Usage

this& = NewTime3&:(str$)

Description

Creates a time object, initialises with date in the string str$ and returns a handle which allows the object to be manipulated.

Parameters
str$ A string contingin a date
Return Value
this& An value which represents the created time
Error Handling

If the object could not be created then an error is generated which should be trapped by an ONERR handler.


NewTime4 - Constructor

Usage

this& = NewTime4&:(datetime&)

Description

Creates a time object, initialises with date and time in the date and time object datetime& and returns a handle which allows the object to be manipulated.

Parameters
datetime& A handle to a date and time object
Return Value
this& An value which represents the created time
Error Handling

If the object could not be created then an error is generated which should be trapped by an ONERR handler.


DeleteTime - Destructor

Usage

DeleteTime:(this&)

Description

Destroys the time object.

Arguments
this& A handle to a time object
Example
  LOCAL this&

  this& = NewTime&:
  DeleteTime:(this&) 

Methods provided


TimeAssignInt64 - assign int64 value

Usage

this& = TimeAssignInt64&:(this&,int64&)

Description

Assigns the value in the int64 object int64& into the time object this&.

Arguments
this& A handle to a time object
int64& A handle to an int64 object
Return value
this& A handle to a time object

TimeAssignDateTime - assign date and time value

Usage

this& = TimeAssignDateTime&:(this&,datetime&)

Description

Assigns the value in the date and time object datetime& into the time object this&.

Arguments
this& A handle to a time object
datetime& A handle to a date and time object
Return value
this& A handle to a time object
Error Handling

If the this& object cannot be created then an error is generated which should be trapped by an ONERR handler.


TimeDateTime - return a date and time value

Usage

datetime& = TimeDateTime&:(this&)

Description

Creates and returns a date and time object.

Arguments
this& A handle to a time object
Return value
datetime& A handle to a date and time object

TimeDayNoInMonth - day number in month

Usage

num& = TimeDayNoInMonth&:(this&)

Description

Returns the number of the day in the month.

Arguments
this& A handle to a time object
Return value
num& The number of the day in the month

TimeDayNoInWeek - day number in week

Usage

num& = TimeDayNoInWeek&:(this&)

Description

Returns the number of the day in the week.

Arguments
this& A handle to a time object
Return value
num& The number of the day in the week

TimeDayNoInYear - day number in year

Usage

num& = TimeDayNoInYear&:(this&,time&,rule%)

Description

Returns the number of the day in the year.

Arguments
this& A handle to a time object
time& A handle to a time object which is to be concidered the start of the year, or 0 for the default value of 1st January
rule% <TBS>
Return value
num& The number of the day in the year

TimeDaysFrom - interval in days

Usage

days& = TimeDaysFrom&:(this&,time&)

Description

.Returns the difference in days between this& and time&.

Arguments
this& A handle to a time object
time& A handle to a time object
Return value
days& The difference in days

TimeDaysInMonth - number of days in month

Usage

num& = TimeDaysInMonth&:(this&)

Description

Returns the number of the days in the month.

Arguments
this& A handle to a time object
Return value
num& The number of the days in the month

TimeFormat - format

Usage

TimeFormat:(this&,des&,fmt$)

Description

Write the time in text form into the descriptor des&, according to the format specified by the string fmt$.

Arguments
this& A handle to a time object
des& A handle to a descriptor object
fmt$ A string specifying the format required
Error Handling

If the time cannot be converted then an error is generated which should be trapped by an ONERR handler.


TimeFormatStr - format

Usage

str$ = TimeFormatStr$:(this&,fmt$)

Description

Write the time in text form into the descriptor des&, according to the format specified by the string fmt$.

Arguments
this& A handle to a time object
fmt$ A string specifying the format required
Return value
str$ A string containing the required time in text format
Error Handling

If the str$ string cannot be created or the time cannot be converted then an error is generated which should be trapped by an ONERR handler.


TimeHomeTime - set to home time

Usage

TimeHomeTime:(this&)

Description

Initialises the time to the home city time..

Arguments
this& A handle to a time object

TimeHoursFrom - interval in hours

Usage

err% = TimeHoursFrom%:(this&,time&,BYREF hours&)

Description

.Returns the difference in hours between this& and time&.

Arguments
this& A handle to a time object
time& A handle to a time object
BYREF hours& The difference in hours
Return value
err% An error code. A non-zero result indicates that the value didn't fit into hours&

TimeMinutesFrom - interval in minutes

Usage

err% = TimeMinutesFrom%:(this&,time&,BYREF minutes&)

Description

.Returns the difference in minutes between this& and time&.

Arguments
this& A handle to a time object
time& A handle to a time object
BYREF minutes& The difference in minutes
Return value
err% An error code. A non-zero result indicates that the value didn't fit into minutes&

TimeMonthsFrom - interval in months

Usage

months& = TimeMonthsFrom&:(this&,time&)

Description

.Returns the difference in months between this& and time&.

Arguments
this& A handle to a time object
time& A handle to a time object
Return value
months& The difference in months

TimeParse - parse the time

Usage

err% = TimeParse%:(this&,str$,century%)

Description

Parses the string str$ and initialises this& with the date and time found in the string..

Arguments
this& A handle to a time object
str$ A string
century% A value between 0 an 99 which is used as the century if the year is specified using only 2 digits
Return value
err% An error code

TimeRoundUpToNextMinute - round up to next minut

Usage

TimeRoundUpToNextMinute:(this&)

Description

Rounds the time up to the next minute.

Arguments
this& A handle to a time object

TimeSecondsFrom - interval in seconds

Usage

err% = TimeSecondsFrom%:(this&,time&,BYREF seconds&)

Description

.Returns the difference in seconds between this& and time&.

Arguments
this& A handle to a time object
time& A handle to a time object
BYREF seconds& The difference in seconds
Return value
err% An error code. A non-zero result indicates that the value didn't fit into seconds&

TimeSet - set time from string

Usage

err% = TimeSet%:(this&,str$)

Description

Set the time from the contents of the string str$.

Arguments
this& A handle to a time object
str$ A string which contains the date
Return value
err% An error code

TimeUniversalTime - set to universal time

Usage

TimeUniversalTime:(this&)

Description

Initialises the time to universal time..

Arguments
this& A handle to a time object

TimeWeekNoInYear - week number in year

Usage

num& = TimeWeekNoInYear&:(this&.start&,rule%)

Description

Returns the week number in the year.

Arguments
this& A handle to a time object
start& A handle to a time object which specifies the start of the year, or 0 for the default of 1st January
rule% The rule which specifies how to determine when the 1st week starts.
Return value
num& The week number