PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFXDateDuration
Class which represents a date duration.
#include <SFXDateDuration.h.hpp>
class SFXDateDuration;
SFMTYPEDEFCLASS(SFXDateDuration)

Description

The SFXDateDuration class is used to perform various operations regarding the SFXDate class. This class has the date duration in seconds internally.

Example 813. Calculate date (subtraction)

SFXDate date1(2008, 10, 12, 22, 45, 58);
SFXDate date2(2008, 10, 12, 22, 55, 48);

// calculate date duration
SFXDateDuration duration = date2 - date1;

SInt32 n1 = duration.AsSInt32(); // n1 = 590

duration.Set(date1 - date2);

SInt32 n2 = duration.AsSInt32(); // n2 = -590

Reference

SFXDate

Member

Constructor/Destructor
SFXDateDuration( Void )
Constructor of the SFXDateDuration class.
SFXDateDuration( SFXDateDurationConstRef param )
Constructor of the SFXDateDuration class.
SFXDateDuration( SInt32 day , SInt32 hour , SInt32 minute , SInt64 second )
Constructor of the SFXDateDuration class.
SFXDateDuration( SInt32 hour , SInt32 minute , SInt64 second )
Constructor of the SFXDateDuration class.
SFXDateDuration( SInt32 minute , SInt64 second )
Constructor of the SFXDateDuration class.
SFXDateDuration( SInt64 second )
Constructor of the SFXDateDuration class.
Public Functions
Void Add( SFXDateDurationConstRef param )
Add the specified date duration to this date duration.
SInt64 AsSInt64( Void )
Convert this date duration into seconds.
SInt32 Compare( SFXDateDurationConstRef param )
Compare this date duration with the specified date duration.
Void Div( SInt32 param )
Divide this date duration by the specified value.
Bool Equals( SFXDateDurationConstRef param )
Check whether this date duration equals the specified date duration or not.
static
SFXDateDuration
LocalTimeOffset( Void )
Get the local time zone offset from UTC.
Void Mod( SInt32 param )
Get the remainder of the divison of this date duration by the specified value.
Void Mul( SInt32 param )
Multiply this date duration by the specified value.
Void Neg( Void )
Negate the sign of the date duration.
static
SFXDateDuration
Offset19000101( Void )
Get the time offset since January 1, 1900.
static
SFXDateDuration
Offset19700101( Void )
Get the time offset since January 1, 1970.
Void Set( SFXDateDurationConstRef param )
Set the date duration.
Void Set( SInt32 day , SInt32 hour , SInt32 minute , SInt64 second )
Set the date duration.
Void Set( SInt32 hour , SInt32 minute , SInt64 second )
Set the date duration.
Void Set( SInt32 minute , SInt64 second )
Set the date duration.
Void Set( SInt64 second )
Set the date duration.
Void Sub( SFXDateDurationConstRef param )
Subtract the specified date duration from this date duration.
static
SFXDateDurationConstRef
ZeroInstance( Void )
Get the instance that represents 0.
SFXDateDurationRef operator%=( SInt32 param )
Get the remainder of the divison of this date duration by the specified value.
SFXDateDurationRef operator*=( SInt32 param )
Multiply this date duration by the specified value.
SFXDateDurationRef operator+=( SFXDateDurationConstRef param )
Add the specified value to this date duration.
SFXDateDurationRef operator-=( SFXDateDurationConstRef param )
Subtract the specified value from this date duration.
SFXDateDurationRef operator/=( SInt32 param )
Divide this date duration by the specified value.
SFXDateDurationRef operator=( SFXDateDurationConstRef param )
Assign the specified date duration.
SFXDateDuration operator/( SFXDateDurationConstRef left , SInt32 right )
Divide this date duration by the specified value.
Bool operator==( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the "==" relation.
Bool operator>=( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the >= relation.
Bool operator>( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the > relation.
Bool operator<=( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the <= relation.
Bool operator<( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the < relation.
SFXDateDuration operator-( Void )
Subtract the specified value from this date duration.
SFXDateDuration operator-( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Subtract the specified value from this date duration.
SFXDateDuration operator%( SFXDateDurationConstRef left , SInt32 right )
Get the remainder of the divison of this date duration by the specified value.
SFXDateDuration operator*( SFXDateDurationConstRef left , SInt32 right )
Multiply this date duration by the specified value.
Bool operator!=( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the "!=" relation.
SFXDateDuration operator+( Void )
Add the specified value to this date duration.
SFXDateDuration operator+( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Add the specified value to this date duration.
Global Functions
SFXDateDuration operator/( SFXDateDurationConstRef left , SInt32 right )
Divide this date duration by the specified value.
Bool operator==( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the "==" relation.
Bool operator>=( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the >= relation.
Bool operator>( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the > relation.
Bool operator<=( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the <= relation.
Bool operator<( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the < relation.
SFXDateDuration operator-( Void )
Subtract the specified value from this date duration.
SFXDateDuration operator-( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Subtract the specified value from this date duration.
SFXDateDuration operator%( SFXDateDurationConstRef left , SInt32 right )
Get the remainder of the divison of this date duration by the specified value.
SFXDateDuration operator*( SFXDateDurationConstRef left , SInt32 right )
Multiply this date duration by the specified value.
Bool operator!=( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Check the "!=" relation.
SFXDateDuration operator+( Void )
Add the specified value to this date duration.
SFXDateDuration operator+( SFXDateDurationConstRef left , SFXDateDurationConstRef right )
Add the specified value to this date duration.

SFXDateDuration::SFXDateDuration
Constructor of the SFXDateDuration class.
[ public, explicit ]
SFXDateDuration(Void);
[ public ]
SFXDateDuration(
    SFXDateDurationConstRef param   // source date duration
);
[ public, explicit ]
SFXDateDuration(
    SInt32 day      // date duration (days)
    SInt32 hour     // date duration (hours)
    SInt32 minute   // date duration (minutes)
    SInt64 second   // date duration (seconds)
);
[ public, explicit ]
SFXDateDuration(
    SInt32 hour     // date duration (hours)
    SInt32 minute   // date duration (minutes)
    SInt64 second   // date duration (seconds)
);
[ public, explicit ]
SFXDateDuration(
    SInt32 minute   // date duration (minutes)
    SInt64 second   // date duration (seconds)
);
[ public, explicit ]
SFXDateDuration(
    SInt64 second   // date duration (seconds)
);

Reference

SFXDateDuration::Set


SFXDateDuration::Add
Add the specified date duration to this date duration.
[ public ]
Void Add(
    SFXDateDurationConstRef param   // date duration to add
);

Reference

SFXDateDuration::Div | SFXDateDuration::Mod | SFXDateDuration::Mul | SFXDateDuration::Neg | SFXDateDuration::Sub


SFXDateDuration::AsSInt64
Convert this date duration into seconds.
[ public, const ]
SInt64 AsSInt64(Void);

SFXDateDuration::Compare
Compare this date duration with the specified date duration.
[ public, const ]
SInt32 Compare(
    SFXDateDurationConstRef param   // date duration to compare with
);

Return value

  • If this date duration is greater: a value greater than 0
  • If equal : 0
  • If this date duration is smaller : a value less than 0

SFXDateDuration::Div
Divide this date duration by the specified value.
[ public ]
Void Div(
    SInt32 param   // value to divide
);

Description

When the value of param argument is 0, this operation is not defined.

Reference

SFXDateDuration::Add | SFXDateDuration::Mod | SFXDateDuration::Mul | SFXDateDuration::Neg | SFXDateDuration::Sub


SFXDateDuration::Equals
Check whether this date duration equals the specified date duration or not.
[ public, const ]
Bool Equals(
    SFXDateDurationConstRef param   // date duration to compare with
);

Return value

  • If equal: true
  • Otherwise: false

Reference

operator== | operator!= | operator> | operator>= | operator< | operator<=


SFXDateDuration::LocalTimeOffset
Get the local time zone offset from UTC.
[ public, static ]
SFXDateDuration LocalTimeOffset(Void);

Reference

SFXHelper::localtimeoffset


SFXDateDuration::Mod
Get the remainder of the divison of this date duration by the specified value.
[ public ]
Void Mod(
    SInt32 param   // value to divide
);

Description

When the value of param argument is 0, this operation is not defined.

Reference

SFXDateDuration::Add | SFXDateDuration::Div | SFXDateDuration::Mul | SFXDateDuration::Neg | SFXDateDuration::Sub


SFXDateDuration::Mul
Multiply this date duration by the specified value.
[ public ]
Void Mul(
    SInt32 param   // value to multiply with
);

Reference

SFXDateDuration::Add | SFXDateDuration::Div | SFXDateDuration::Mod | SFXDateDuration::Neg | SFXDateDuration::Sub


SFXDateDuration::Neg
Negate the sign of the date duration.
[ public ]
Void Neg(Void);

Reference

SFXDateDuration::Add | SFXDateDuration::Div | SFXDateDuration::Mod | SFXDateDuration::Mul | SFXDateDuration::Sub


SFXDateDuration::Offset19000101
Get the time offset since January 1, 1900.
[ public, static ]
SFXDateDuration Offset19000101(Void);

Description

Return the time offset since January 1, 1900, 0:0:0.

Example

Calculate the elapsed time from January 1, 1900, 0:0:0 to July 21, 2008, 12:14:35.

SFXDate date(2008, 7, 21, 12, 14, 35);
SFXDateDuration duration(date.AsUInt32());
UInt64 second;

duration += SFXDateDuration::Offset19000101();
second = duration.AsSInt64();

Reference

SFXDateDuration::Offset19700101


SFXDateDuration::Offset19700101
Get the time offset since January 1, 1970.
[ public, static ]
SFXDateDuration Offset19700101(Void);

Description

Return the time offset since January 1, 1970, 0:0:0.

Example

Calculate the elapsed time from January 1, 1970, 0:0:0 to July 21, 2008, 12:14:35.

SFXDate date(2008, 7, 21, 12, 14, 35);
SFXDateDuration duration(date.AsUInt32());
UInt64 second;

duration += SFXDateDuration::Offset19700101();
second = duration.AsSInt64();

Reference

SFXDateDuration::Offset19000101


SFXDateDuration::Set
Set the date duration.
[ public ]
Void Set(
    SFXDateDurationConstRef param   // value to set (date duration)
);
[ public ]
Void Set(
    SInt32 day      // value to set (day)
    SInt32 hour     // value to set (hours)
    SInt32 minute   // value to set (minutes)
    SInt64 second   // value to set (seconds)
);
[ public ]
Void Set(
    SInt32 hour     // value to set (hours)
    SInt32 minute   // value to set (minutes)
    SInt64 second   // value to set (seconds)
);
[ public ]
Void Set(
    SInt32 minute   // value to set (minutes)
    SInt64 second   // value to set (seconds)
);
[ public ]
Void Set(
    SInt64 second   // value to set (seconds)
);

SFXDateDuration::Sub
Subtract the specified date duration from this date duration.
[ public ]
Void Sub(
    SFXDateDurationConstRef param   // date duration to subtract
);

Reference

SFXDateDuration::Add | SFXDateDuration::Div | SFXDateDuration::Mod | SFXDateDuration::Mul | SFXDateDuration::Neg


SFXDateDuration::ZeroInstance
Get the instance that represents 0.
[ public, static ]
SFXDateDurationConstRef ZeroInstance(Void);

Description

Return the instance where every member variable is 0.


SFXDateDuration::operator=
Assign the specified date duration.
[ public ]
SFXDateDurationRef operator=(
    SFXDateDurationConstRef param   // date duration to assign
);

Reference

operator% | SFXDateDuration::operator%= | operator/ | SFXDateDuration::operator/= | operator- | SFXDateDuration::operator-= | operator* | SFXDateDuration::operator*= | operator+ | SFXDateDuration::operator+=


SFXDateDuration::operator/=
Divide this date duration by the specified value.
[ public ]
SFXDateDurationRef operator/=(
    SInt32 param   // value to divide
);

Description

When the value of param argument is 0, this operation is not defined.

Reference

operator% | SFXDateDuration::operator%= | SFXDateDuration::operator= | operator/ | operator- | SFXDateDuration::operator-= | operator* | SFXDateDuration::operator*= | operator+ | SFXDateDuration::operator+=


operator/
Divide this date duration by the specified value.
[ public, friend ]
SFXDateDuration operator/(
    SFXDateDurationConstRef left   // date duration
    SInt32 right                   // value to divide
);

Description

When the value of right argument is 0, this operation is not defined.

Reference

operator% | SFXDateDuration::operator%= | SFXDateDuration::operator= | SFXDateDuration::operator/= | operator- | SFXDateDuration::operator-= | operator* | SFXDateDuration::operator*= | operator+ | SFXDateDuration::operator+=


operator==
Check the "==" relation.
[ public, friend ]
Bool operator==(
    SFXDateDurationConstRef left    // date duration to be compared
    SFXDateDurationConstRef right   // date duration to compared with
);

Return value

  • If equal: true
  • Otherwise: false

Reference

SFXDateDuration::Equals | operator> | operator>= | operator< | operator<= | operator!=


operator>=
Check the >= relation.
[ public, friend ]
Bool operator>=(
    SFXDateDurationConstRef left    // date duration to be compared
    SFXDateDurationConstRef right   // date duration to compared with
);

Return value

  • If left equals or is greater than right: true
  • Otherwise: false

Reference

SFXDateDuration::Equals | operator== | operator> | operator< | operator<= | operator!=


operator>
Check the > relation.
[ public, friend ]
Bool operator>(
    SFXDateDurationConstRef left    // date duration to be compared
    SFXDateDurationConstRef right   // date duration to compared with
);

Return value

  • If left is greater than right: true
  • Otherwise: false

Reference

SFXDateDuration::Equals | operator== | operator> | operator< | operator<= | operator!=


operator<=
Check the <= relation.
[ public, friend ]
Bool operator<=(
    SFXDateDurationConstRef left    // date duration to be compared
    SFXDateDurationConstRef right   // date duration to compare with
);

Return value

  • If left eqauls or is less than right: true
  • Otherwise: false

Reference

SFXDateDuration::Equals | operator== | operator> | operator>= | operator< | operator!=


operator<
Check the < relation.
[ public, friend ]
Bool operator<(
    SFXDateDurationConstRef left    // date duration to be compared
    SFXDateDurationConstRef right   // date duration to compare with
);

Return value

  • If left less than right: true
  • Otherwise: false

Reference

SFXDateDuration::Equals | operator== | operator> | operator>= | operator<= | operator!=


SFXDateDuration::operator-=
Subtract the specified value from this date duration.
[ public ]
SFXDateDurationRef operator-=(
    SFXDateDurationConstRef param   // value to subtract
);

Reference

operator% | SFXDateDuration::operator%= | SFXDateDuration::operator= | operator/ | SFXDateDuration::operator/= | operator- | operator* | SFXDateDuration::operator*= | operator+ | SFXDateDuration::operator+=


operator-
Subtract the specified value from this date duration.
[ public, const ]
SFXDateDuration operator-(Void);
[ public, friend ]
SFXDateDuration operator-(
    SFXDateDurationConstRef left    // date duration to be subtracted from
    SFXDateDurationConstRef right   // value to subtract
);

Reference

operator% | SFXDateDuration::operator%= | SFXDateDuration::operator= | operator/ | SFXDateDuration::operator/= | SFXDateDuration::operator-= | operator* | SFXDateDuration::operator*= | operator+ | SFXDateDuration::operator+=


SFXDateDuration::operator%=
Get the remainder of the divison of this date duration by the specified value.
[ public ]
SFXDateDurationRef operator%=(
    SInt32 param   // value to divide
);

Description

When the value of param argument is 0, this operation is not defined.

Reference

operator% | SFXDateDuration::operator= | operator/ | SFXDateDuration::operator/= | operator- | SFXDateDuration::operator-= | operator* | SFXDateDuration::operator*= | operator+ | SFXDateDuration::operator+=


operator%
Get the remainder of the divison of this date duration by the specified value.
[ public, friend ]
SFXDateDuration operator%(
    SFXDateDurationConstRef left   // date duration to be divided
    SInt32 right                   // value to divide
);

Description

When the value of right argument is 0, this operation is not defined.

Reference

SFXDateDuration::operator%= | SFXDateDuration::operator= | operator/ | SFXDateDuration::operator/= | operator- | SFXDateDuration::operator-= | operator* | SFXDateDuration::operator*= | operator+ | SFXDateDuration::operator+=


SFXDateDuration::operator*=
Multiply this date duration by the specified value.
[ public ]
SFXDateDurationRef operator*=(
    SInt32 param   // value to multiply
);

Reference

operator% | SFXDateDuration::operator%= | SFXDateDuration::operator= | operator/ | SFXDateDuration::operator/= | operator- | SFXDateDuration::operator-= | operator* | operator+ | SFXDateDuration::operator+=


operator*
Multiply this date duration by the specified value.
[ public, friend ]
SFXDateDuration operator*(
    SFXDateDurationConstRef left   // date duration to be multiplied
    SInt32 right                   // value to multiply
);

Reference

operator% | SFXDateDuration::operator%= | SFXDateDuration::operator= | operator/ | SFXDateDuration::operator/= | operator- | SFXDateDuration::operator-= | SFXDateDuration::operator*= | operator+ | SFXDateDuration::operator+=


operator!=
Check the "!=" relation.
[ public, friend ]
Bool operator!=(
    SFXDateDurationConstRef left    // date duration to be compared
    SFXDateDurationConstRef right   // date duration to compare with
);

Return value

  • If not equal: true
  • Otherwise: false

Reference

SFXDateDuration::Equals | operator== | operator> | operator>= | operator< | operator<=


SFXDateDuration::operator+=
Add the specified value to this date duration.
[ public ]
SFXDateDurationRef operator+=(
    SFXDateDurationConstRef param   // value to add
);

Reference

operator% | SFXDateDuration::operator%= | SFXDateDuration::operator= | operator/ | SFXDateDuration::operator/= | operator- | SFXDateDuration::operator-= | operator* | SFXDateDuration::operator*= | operator+


operator+
Add the specified value to this date duration.
[ public, const ]
SFXDateDuration operator+(Void);
[ public, friend ]
SFXDateDuration operator+(
    SFXDateDurationConstRef left    // date duration to be added
    SFXDateDurationConstRef right   // value to add
);

Reference

operator% | SFXDateDuration::operator%= | SFXDateDuration::operator= | operator/ | SFXDateDuration::operator/= | operator- | SFXDateDuration::operator-= | operator* | SFXDateDuration::operator*= | SFXDateDuration::operator+=