Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Duration Source Code
 previous   up   next 

Types
duration
Describes time and date durations.

duration

const type: duration

Describes time and date durations.


Operator Summary
duration
(attr duration) parse (in var string: stri)
Convert a string to a duration.
boolean
(in duration: aDuration1) = (in duration: aDuration2)
Check if two duration values are equal.
boolean
(in duration: aDuration1) <> (in duration: aDuration2)
Check if two duration values are not equal.
boolean
(in duration: aDuration1) <= (in duration: aDuration2)
Check if aDuration1 is less than or equal to aDuration2.
boolean
(in duration: aDuration1) >= (in duration: aDuration2)
Check if aDuration1 is greater than or equal to aDuration2.
boolean
(in duration: aDuration1) < (in duration: aDuration2)
Check if aDuration1 is less than aDuration2.
boolean
(in duration: aDuration1) > (in duration: aDuration2)
Check if aDuration1 is greater than aDuration2.
duration
+ (in duration: aDuration)
Plus sign for durations.
duration
- (in duration: aDuration)
Minus sign, negate a duration.
duration
(in duration: aDuration1) + (in duration: aDuration2)
Add two durations.
duration
(in duration: aDuration1) - (in duration: aDuration2)
Compute the subtraction of two durations.
duration
(in integer: number) * (in duration: aDuration)
Multiply a duration by a number.
duration
(in duration: aDuration) * (in integer: number)
Multiply a duration by a number.
void
(inout duration: aDuration) +:= (in duration: delta)
Increment a duration by a delta.
void
(inout duration: aDuration) -:= (in duration: delta)
Decrement a duration by a delta.
void
(inout time: tim) +:= (in duration: aDuration)
Increment a time by a duration.
void
(inout time: tim) -:= (in duration: aDuration)
Decrement a time by a duration.
time
(in time: tim) + (in duration: aDuration)
Add a duration to a time.
time
(in time: tim) - (in duration: aDuration)
Subtract a duration from a time.
duration
(in time: tim1) - (in time: tim2)
Subtract two times.

Function Summary
integer
getYears (in duration: aDuration)
Obtain the years of a duration.
integer
getMonths (in duration: aDuration)
Obtain the months of a duration.
integer
getDays (in duration: aDuration)
Obtain the days of a duration.
integer
getHours (in duration: aDuration)
Obtain the hours of a duration.
integer
getMinutes (in duration: aDuration)
Obtain the minutes of a duration.
integer
getSeconds (in duration: aDuration)
Obtain the seconds of a duration.
integer
getMicroSeconds (in duration: aDuration)
Obtain the micro seconds of a duration.
string
str (in duration: aDuration)
Convert a duration to a string.
integer
compare (in duration: aDuration1, in duration: aDuration2)
Compares two durations.
integer
hashCode (in duration: aDuration)
Compute the hash value of aDuration.
integer
toYears (in duration: aDuration)
Compute the years of aDuration.
integer
toMonths (in duration: aDuration)
Compute the months of aDuration.
integer
toDays (in duration: aDuration)
Compute the days of aDuration.
integer
toHours (in duration: aDuration)
Compute the hours of aDuration.
integer
toMinutes (in duration: aDuration)
Compute the minutes of aDuration.
integer
toSeconds (in duration: aDuration)
Compute the seconds of aDuration.
integer
toMicroSeconds (in duration: aDuration)
Compute the micro seconds of aDuration.
void
wait (in duration: aDuration)
Wait for a given duration.

Operator Detail

parse

const func duration: (attr duration) parse (in var string: stri)

Convert a string to a duration. Accepts durations in the format Y-M-D H:M:S were single digits or bigger integer numbers can be used.

Returns:
the duration result of the conversion.
Raises:
RANGE_ERROR - When stri contains not a valid duration value.

=

const func boolean: (in duration: aDuration1) = (in duration: aDuration2)

Check if two duration values are equal.

Returns:
TRUE if both durations are equal, FALSE otherwise.

<>

const func boolean: (in duration: aDuration1) <> (in duration: aDuration2)

Check if two duration values are not equal.

Returns:
FALSE if both durations are equal, TRUE otherwise.

<=

const func boolean: (in duration: aDuration1) <= (in duration: aDuration2)

Check if aDuration1 is less than or equal to aDuration2.

Returns:
TRUE if aDuration1 is less than or equal to aDuration2, FALSE otherwise.

>=

const func boolean: (in duration: aDuration1) >= (in duration: aDuration2)

Check if aDuration1 is greater than or equal to aDuration2.

Returns:
TRUE if aDuration1 is greater than or equal to aDuration2, FALSE otherwise.

<

const func boolean: (in duration: aDuration1) < (in duration: aDuration2)

Check if aDuration1 is less than aDuration2.

Returns:
TRUE if aDuration1 is less than aDuration2, FALSE otherwise.

>

const func boolean: (in duration: aDuration1) > (in duration: aDuration2)

Check if aDuration1 is greater than aDuration2.

Returns:
TRUE if aDuration1 is greater than aDuration2, FALSE otherwise.

+

const func duration: + (in duration: aDuration)

Plus sign for durations.

Returns:
its operand unchanged.

-

const func duration: - (in duration: aDuration)

Minus sign, negate a duration.

Returns:
the negated duration.

+

const func duration: (in duration: aDuration1) + (in duration: aDuration2)

Add two durations.

Returns:
the sum of the two durations.

-

const func duration: (in duration: aDuration1) - (in duration: aDuration2)

Compute the subtraction of two durations.

Returns:
the difference of the two durations.

*

const func duration: (in integer: number) * (in duration: aDuration)

Multiply a duration by a number.

Returns:
the multiplied duration.

*

const func duration: (in duration: aDuration) * (in integer: number)

Multiply a duration by a number.

Returns:
the multiplied duration.

+:=

const proc: (inout duration: aDuration) +:= (in duration: delta)

Increment a duration by a delta.


-:=

const proc: (inout duration: aDuration) -:= (in duration: delta)

Decrement a duration by a delta.


+:=

const proc: (inout time: tim) +:= (in duration: aDuration)

Increment a time by a duration.


-:=

const proc: (inout time: tim) -:= (in duration: aDuration)

Decrement a time by a duration.


+

const func time: (in time: tim) + (in duration: aDuration)

Add a duration to a time.

Returns:
the time result of the addition.

-

const func time: (in time: tim) - (in duration: aDuration)

Subtract a duration from a time.

Returns:
the time result of the subtraction.

-

const func duration: (in time: tim1) - (in time: tim2)

Subtract two times.

Returns:
the duration between the two points in time.

Function Detail

getYears

const func integer: getYears (in duration: aDuration)

Obtain the years of a duration.

Returns:
the years of a duration.

getMonths

const func integer: getMonths (in duration: aDuration)

Obtain the months of a duration.

Returns:
the months of a duration.

getDays

const func integer: getDays (in duration: aDuration)

Obtain the days of a duration.

Returns:
the days of a duration.

getHours

const func integer: getHours (in duration: aDuration)

Obtain the hours of a duration.

Returns:
the hours of a duration.

getMinutes

const func integer: getMinutes (in duration: aDuration)

Obtain the minutes of a duration.

Returns:
the minutes of a duration.

getSeconds

const func integer: getSeconds (in duration: aDuration)

Obtain the seconds of a duration.

Returns:
the seconds of a duration.

getMicroSeconds

const func integer: getMicroSeconds (in duration: aDuration)

Obtain the micro seconds of a duration.

Returns:
the micro seconds of a duration.

str

const func string: str (in duration: aDuration)

Convert a duration to a string.

Returns:
the result of the conversion.

compare

const func integer: compare (in duration: aDuration1, in duration: aDuration2)

Compares two durations.

Returns:
-1, 0 or 1 if the first argument is considered to be respectively less than, equal to, or greater than the second.

hashCode

const func integer: hashCode (in duration: aDuration)

Compute the hash value of aDuration.

Returns:
the hash value.

toYears

const func integer: toYears (in duration: aDuration)

Compute the years of aDuration.

Returns:
the duration in years.

toMonths

const func integer: toMonths (in duration: aDuration)

Compute the months of aDuration.

Returns:
the duration in months.

toDays

const func integer: toDays (in duration: aDuration)

Compute the days of aDuration.

Returns:
the duration in days.

toHours

const func integer: toHours (in duration: aDuration)

Compute the hours of aDuration.

Returns:
the duration in hours.

toMinutes

const func integer: toMinutes (in duration: aDuration)

Compute the minutes of aDuration.

Returns:
the duration in minutes.

toSeconds

const func integer: toSeconds (in duration: aDuration)

Compute the seconds of aDuration.

Returns:
the duration in seconds.

toMicroSeconds

const func integer: toMicroSeconds (in duration: aDuration)

Compute the micro seconds of aDuration.

Returns:
the duration in micro seconds.

wait

const proc: wait (in duration: aDuration)

Wait for a given duration.



 previous   up   next