SophiaFramework UNIVERSE 5.3 |
The SFXDate class internally manages the elapsed time since January 6, 1980, 00:00:00 in seconds. The SFXDateDuration class can be also used for the addition and subtraction of dates and times.
Constructor/Destructor |
---|
SFXDate( Void ) Constructor of the SFXDate class.
|
SFXDate(
SFXDateConstRef param
) Constructor of the SFXDate class.
|
SFXDate(
UInt16 year
, UInt16 month
, UInt16 day
, UInt16 hour
, UInt16 minute
, UInt16 second
) Constructor of the SFXDate class.
|
SFXDate(
UInt16 year
, UInt16 month
, UInt16 day
) Constructor of the SFXDate class.
|
SFXDate(
UInt32 second
) Constructor of the SFXDate class.
|
SFXDate(
JulianTypeConstRef julian
) Constructor of the SFXDate class.
|
Public Functions | |
---|---|
Void |
Add(
SFXDateDurationConstRef param
) Add the specified date duration.
|
Void |
AddDay(
UInt16 param
) Add the specified number of days.
|
Void |
AddHour(
UInt16 param
) Add the specified number of hours.
|
Void |
AddMinute(
UInt16 param
) Add the specified number of minutes.
|
Void |
AddMonth(
UInt16 param
) Add the specified number of months.
|
Void |
AddSecond(
UInt16 param
) Add the specified number of seconds.
|
Void |
AddYear(
UInt16 param
) Add the specified number of years.
|
JulianType |
AsJulianType( Void ) Convert this date into Julian date.
|
UInt32 |
AsUInt32( Void ) Convert this date into the elapsed time in seconds since January 6, 1980 00:00:00.
|
SInt32 |
Compare(
SFXDateConstRef param
) Compare this date with the specified date.
|
static SFXDate |
CurrentDate( Void ) Get the current date/time.
|
static SFXDate |
CurrentUTCDate( Void ) Get the current date/time in UTC.
|
SFXDateDuration |
DurationTo(
SFXDateConstRef param
) Get the date duration from this date to the specified date.
|
Bool |
Equals(
SFXDateConstRef param
) Check whether this date equals the specified date or not.
|
SFXAnsiString |
Format(
SFXAnsiStringConstRef format
) Convert this date into the string in the specified format.
|
UInt16 |
GetDay( Void ) Get the day of this date.
|
DayOfWeekEnum |
GetDayOfWeek( Void ) Get the day of the week of this date.
|
UInt16 |
GetHour( Void ) Get the hour of this date.
|
UInt16 |
GetMinute( Void ) Get the minute of this date.
|
UInt16 |
GetMonth( Void ) Get the month of this date.
|
UInt16 |
GetSecond( Void ) Get the second of this date.
|
UInt16 |
GetYear( Void ) Get the year of this date.
|
SFCError |
Parse(
SFXAnsiStringConstRef format
, SFXAnsiStringConstRef string
) Convert the specified string in a format into date.
|
Void |
Set(
SFXDateConstRef param
) Set a date.
|
Void |
Set(
UInt16 year
, UInt16 month
, UInt16 day
, UInt16 hour
, UInt16 minute
, UInt16 second
) Set a date.
|
Void |
Set(
UInt16 year
, UInt16 month
, UInt16 day
) Set a date.
|
Void |
Set(
UInt32 second
) Set a date.
|
Void |
Set(
JulianTypeConstRef julian
) Set a date.
|
Void |
SetDate(
UInt16 year
, UInt16 month
, UInt16 day
) Set the specified date(year, month, and day) to this date.
|
Void |
SetDay(
UInt16 param
) Set the specified day to this date.
|
Void |
SetHour(
UInt16 param
) Set the specified hour to this date.
|
Void |
SetMinute(
UInt16 param
) Set the specified minute to this date.
|
Void |
SetMonth(
UInt16 param
) Set the specified month to this date.
|
Void |
SetSecond(
UInt16 param
) Set the specified second to this date.
|
Void |
SetTime(
UInt16 hour
, UInt16 minute
, UInt16 second
) Set the specified time(hour, minute, and second).
|
Void |
SetYear(
UInt16 param
) Set the specified year to this date.
|
Void |
Sub(
SFXDateDurationConstRef param
) Subtract the specified date duration.
|
Void |
SubDay(
UInt16 param
) Subtract the specified number of days.
|
Void |
SubHour(
UInt16 param
) Subtract the specified number of hours.
|
Void |
SubMinute(
UInt16 param
) Subtract the specified number of minutes.
|
Void |
SubMonth(
UInt16 param
) Subtract the specified number of months.
|
Void |
SubSecond(
UInt16 param
) Subtract the specified number of seconds.
|
Void |
SubYear(
UInt16 param
) Subtract the specified number of years.
|
static SFXDateConstRef |
ZeroInstance( Void ) Get the instance that represents 0.
|
SFXDateRef |
operator+=(
SFXDateDurationConstRef param
) Add the specified date duration.
|
SFXDateRef |
operator-=(
SFXDateDurationConstRef param
) Subtract the specified number of seconds.
|
SFXDateRef |
operator=(
SFXDateConstRef param
) Assign a date.
|
Bool |
operator==(
SFXDateConstRef left
, SFXDateConstRef right
) Check the == (equality) relation.
|
Bool |
operator>=(
SFXDateConstRef left
, SFXDateConstRef right
) Check the >= relation.
|
Bool |
operator>(
SFXDateConstRef left
, SFXDateConstRef right
) Check the > relation.
|
Bool |
operator<=(
SFXDateConstRef left
, SFXDateConstRef right
) Check the <= relation.
|
Bool |
operator<(
SFXDateConstRef left
, SFXDateConstRef right
) Check the < relation.
|
SFXDate |
operator-(
SFXDateConstRef left
, SFXDateDurationConstRef right
) Subtract the specified number of seconds.
|
SFXDateDuration |
operator-(
SFXDateConstRef left
, SFXDateConstRef right
) Subtract the specified number of seconds.
|
Bool |
operator!=(
SFXDateConstRef left
, SFXDateConstRef right
) Check the "!=" relation.
|
SFXDate |
operator+(
SFXDateConstRef left
, SFXDateDurationConstRef right
) Add the specified date duration.
|
Types |
---|
DayOfWeekEnum Constants that represent days of the week.
|
Global Functions | |
---|---|
Bool |
operator==(
SFXDateConstRef left
, SFXDateConstRef right
) Check the == (equality) relation.
|
Bool |
operator>=(
SFXDateConstRef left
, SFXDateConstRef right
) Check the >= relation.
|
Bool |
operator>(
SFXDateConstRef left
, SFXDateConstRef right
) Check the > relation.
|
Bool |
operator<=(
SFXDateConstRef left
, SFXDateConstRef right
) Check the <= relation.
|
Bool |
operator<(
SFXDateConstRef left
, SFXDateConstRef right
) Check the < relation.
|
SFXDate |
operator-(
SFXDateConstRef left
, SFXDateDurationConstRef right
) Subtract the specified number of seconds.
|
SFXDateDuration |
operator-(
SFXDateConstRef left
, SFXDateConstRef right
) Subtract the specified number of seconds.
|
Bool |
operator!=(
SFXDateConstRef left
, SFXDateConstRef right
) Check the "!=" relation.
|
SFXDate |
operator+(
SFXDateConstRef left
, SFXDateDurationConstRef right
) Add the specified date duration.
|
[ public, explicit ] SFXDate(Void);
[ public ] SFXDate( SFXDateConstRef param // source date );
[ public, explicit ] SFXDate( UInt16 year // year UInt16 month // month UInt16 day // day UInt16 hour // hour UInt16 minute // minute UInt16 second // second );
[ public, explicit ] SFXDate( UInt16 year // year UInt16 month // month UInt16 day // day );
[ public, explicit ] SFXDate( UInt32 second // elapsed time in seconds since January 6, 1980 00:00:00. );
[ public, explicit ] SFXDate( JulianTypeConstRef julian // julian date );
[ public ] Void Add( SFXDateDurationConstRef param // date duration to add );
SFXDateDuration | SFXDate::AddDay | SFXDate::AddHour | SFXDate::AddMinute | SFXDate::AddMonth | SFXDate::AddSecond | SFXDate::AddYear | SFXDate::Sub
SFXDate::Add | SFXDate::AddHour | SFXDate::AddMinute | SFXDate::AddMonth | SFXDate::AddSecond | SFXDate::AddYear | SFXDate::SubDay
SFXDate::Add | SFXDate::AddDay | SFXDate::AddMinute | SFXDate::AddMonth | SFXDate::AddSecond | SFXDate::AddYear | SFXDate::SubHour
SFXDate::Add | SFXDate::AddDay | SFXDate::AddHour | SFXDate::AddMonth | SFXDate::AddSecond | SFXDate::AddYear | SFXDate::SubMinute
SFXDate::Add | SFXDate::AddDay | SFXDate::AddHour | SFXDate::AddMinute | SFXDate::AddSecond | SFXDate::AddYear | SFXDate::SubMonth
SFXDate::Add | SFXDate::AddDay | SFXDate::AddHour | SFXDate::AddMinute | SFXDate::AddMonth | SFXDate::AddYear | SFXDate::SubSecond
SFXDate::Add | SFXDate::AddDay | SFXDate::AddHour | SFXDate::AddMinute | SFXDate::AddMonth | SFXDate::AddSecond | SFXDate::SubYear
[ public, const ] JulianType AsJulianType(Void);
[ public, const ] UInt32 AsUInt32(Void);
[ public, const ] SInt32 Compare( SFXDateConstRef param // date to compare with );
[ public, static ] SFXDate CurrentDate(Void);
date = SFXDate::CurrentDate();
[ public, static ] SFXDate CurrentUTCDate(Void);
[ public, const ] SFXDateDuration DurationTo( SFXDateConstRef param // target date );
[ public, const ] Bool Equals( SFXDateConstRef param // date to compare with );
[ public, const ] SFXAnsiString Format( SFXAnsiStringConstRef format // format );
The following formats are available.
Y - N-digit year YY - 2-digit year YYYY - 4-digit year M - N-digit month MM - 2-digit month D - N-digit day DD - 2-digit day h - N-digit hour 0 ~ 23 hh - 2-digit hour 00 ~ 23 H - N-digit hour 1 ~ 12 HH - 2-digit hour 01 ~ 12 m - N-digit minute mm - 2-digit minute s - N-digit second ss - 2-digit second A - AM / PM a - am / pm MONTH - name of month (full name in capital letters) Month - name of month (full name, and first leter is capital) month - name of month (full name in small letters) MTH - name of month (3 letters in capital) Mth - name of month (3 letters with the first is capital) mth - name of month (3 letters in small) WEEK - day of week (full name in capital letters) Week - day of week (full name, and first leter is capital) week - day of week (full name in small letters) WEK - day of week (3 letters in capital) Wek - day of week (3 letters with the first is capital) wek - day of week (3 letters in small) y - day of week (Japanese) %x - letter 'x'
Besides, any character other than alphabets and numbers can be used.
To use an alphabet: escape with '%'.
If more than space characters in the format are lined up, these additional space characters will be skipped.
If the number of letters is insufficient, an error occurs.
SFXDate date(2010, 3, 9, 14, 12, 50); date.Format("YYYY/MM/DD hh:mm:ss"); // "2010/03/09 14:12:50" date.Format(""DD Mth, YY"); // "09 Mar, 10"
[ public, const ] UInt16 GetDay(Void);
SFXDate::GetDayOfWeek | SFXDate::GetHour | SFXDate::GetMinute | SFXDate::GetMonth | SFXDate::GetSecond | SFXDate::GetYear | SFXDate::SetDay
[ public, const ] DayOfWeekEnum GetDayOfWeek(Void);
Return SFXDate::DayOfWeekEnum type.
[ public, const ] UInt16 GetHour(Void);
SFXDate::GetDay | SFXDate::GetDayOfWeek | SFXDate::GetMinute | SFXDate::GetMonth | SFXDate::GetSecond | SFXDate::GetYear | SFXDate::SetHour
[ public, const ] UInt16 GetMinute(Void);
SFXDate::GetDay | SFXDate::GetDayOfWeek | SFXDate::GetHour | SFXDate::GetMonth | SFXDate::GetSecond | SFXDate::GetYear | SFXDate::SetMinute
[ public, const ] UInt16 GetMonth(Void);
SFXDate::GetDay | SFXDate::GetDayOfWeek | SFXDate::GetHour | SFXDate::GetMinute | SFXDate::GetSecond | SFXDate::GetYear | SFXDate::SetMonth
[ public, const ] UInt16 GetSecond(Void);
SFXDate::GetDay | SFXDate::GetDayOfWeek | SFXDate::GetHour | SFXDate::GetMinute | SFXDate::GetMonth | SFXDate::GetYear | SFXDate::SetSecond
[ public, const ] UInt16 GetYear(Void);
SFXDate::GetDay | SFXDate::GetDayOfWeek | SFXDate::GetHour | SFXDate::GetMinute | SFXDate::GetMonth | SFXDate::GetSecond | SFXDate::SetYear
[ public ] SFCError Parse( SFXAnsiStringConstRef format // format SFXAnsiStringConstRef string // string to be converted into date );
The following formats are available.
Y - N-digit year YY - 2-digit year YYYY - 4-digit year M - N-digit month MM - 2-digit month D - N-digit day DD - 2-digit day h - N-digit hour 0 ~ 23 hh - 2-digit hour 00 ~ 23 H - N-digit hour 1 ~ 12 HH - 2-digit hour 01 ~ 12 m - N-digit minute mm - 2-digit minute s - N-digit second ss - 2-digit second A - AM / PM a - am / pm MONTH - name of month (full name in capital letters) Month - name of month (full name, and first leter is capital) month - name of month (full name in small letters) MTH - name of month (3 letters in capital) Mth - name of month (3 letters with the first is capital) mth - name of month (3 letters in small) WEEK - day of week (full name in capital letters) Week - day of week (full name, and first leter is capital) week - day of week (full name in small letters) WEK - day of week (3 letters in capital) Wek - day of week (3 letters with the first is capital) wek - day of week (3 letters in small) y - day of week (Japanese) %x - letter 'x'
Besides, any character other than alphabets and numbers can be used.
To use an alphabet: escape with '%'.
If more than space characters in the format are lined up, these additional space characters will be skipped.
If the number of letters is insufficient, an error occurs.
Get the string converted to date.
SFXDate date; // convert the string to date according the format "YYYY/MM/DD hh:mm:ss" date.Parse("YYYY/MM/DD hh:mm:ss", "2006/06/15 15:13:30"); // display character 'M' by %M // two or more white spaces are considered to be one. date.Parse("%M%y = YYYY/MM/DD hh:mm:ss", "My = 2006/06/15 15:13:30");
[ public ] Void Set( SFXDateConstRef param // date (SFXDate) );
[ public ] Void Set( UInt16 year // year UInt16 month // month UInt16 day // day UInt16 hour // hour UInt16 minute // minute UInt16 second // second );
[ public ] Void Set( UInt16 year // year UInt16 month // month UInt16 day // day );
[ public ] Void Set( UInt32 second // number of seconds since January 6, 1980 00:00:00. );
[ public ] Void Set( JulianTypeConstRef julian // julian date );
In case of the function prototype that only year, month, and date are specified as arguments, 0 is set to hour, minute, and second of this date.
SFXDate::SetDate | SFXDate::SetDay | SFXDate::SetHour | SFXDate::SetMinute | SFXDate::SetMonth | SFXDate::SetSecond | SFXDate::SetTime | SFXDate::SetYear | SFXDate::operator=
SFXDate::Set | SFXDate::SetDay | SFXDate::SetHour | SFXDate::SetMinute | SFXDate::SetMonth | SFXDate::SetSecond | SFXDate::SetTime | SFXDate::SetYear
SFXDate::GetDay | SFXDate::Set | SFXDate::SetDate | SFXDate::SetHour | SFXDate::SetMinute | SFXDate::SetMonth | SFXDate::SetSecond | SFXDate::SetTime | SFXDate::SetYear
SFXDate::GetHour | SFXDate::Set | SFXDate::SetDate | SFXDate::SetDay | SFXDate::SetMinute | SFXDate::SetMonth | SFXDate::SetSecond | SFXDate::SetTime | SFXDate::SetYear
SFXDate::GetMinute | SFXDate::Set | SFXDate::SetDate | SFXDate::SetDay | SFXDate::SetHour | SFXDate::SetMonth | SFXDate::SetSecond | SFXDate::SetTime | SFXDate::SetYear
SFXDate::GetMonth | SFXDate::Set | SFXDate::SetDate | SFXDate::SetDay | SFXDate::SetHour | SFXDate::SetMinute | SFXDate::SetSecond | SFXDate::SetTime | SFXDate::SetYear
SFXDate::GetSecond | SFXDate::Set | SFXDate::SetDate | SFXDate::SetDay | SFXDate::SetHour | SFXDate::SetMinute | SFXDate::SetMonth | SFXDate::SetTime | SFXDate::SetYear
SFXDate::Set | SFXDate::SetDate | SFXDate::SetDay | SFXDate::SetHour | SFXDate::SetMinute | SFXDate::SetMonth | SFXDate::SetSecond | SFXDate::SetYear
SFXDate::GetYear | SFXDate::Set | SFXDate::SetDate | SFXDate::SetDay | SFXDate::SetHour | SFXDate::SetMinute | SFXDate::SetMonth | SFXDate::SetSecond | SFXDate::SetTime
[ public ] Void Sub( SFXDateDurationConstRef param // date duration );
SFXDateDuration | SFXDate::Add | SFXDate::SubDay | SFXDate::SubHour | SFXDate::SubMinute | SFXDate::SubMonth | SFXDate::SubSecond | SFXDate::SubYear |
SFXDate::AddDay | SFXDate::Sub | SFXDate::SubHour | SFXDate::SubMinute | SFXDate::SubMonth | SFXDate::SubSecond | SFXDate::SubYear
SFXDate::AddHour | SFXDate::Sub | SFXDate::SubDay | SFXDate::SubMinute | SFXDate::SubMonth | SFXDate::SubSecond | SFXDate::SubYear
SFXDate::AddMinute | SFXDate::Sub | SFXDate::SubDay | SFXDate::SubHour | SFXDate::SubMonth | SFXDate::SubSecond | SFXDate::SubYear
SFXDate::AddMonth | SFXDate::Sub | SFXDate::SubDay | SFXDate::SubHour | SFXDate::SubMinute | SFXDate::SubSecond | SFXDate::SubYear
SFXDate::AddSecond | SFXDate::Sub | SFXDate::SubDay | SFXDate::SubHour | SFXDate::SubMinute | SFXDate::SubMonth | SFXDate::SubYear
SFXDate::AddYear | SFXDate::Sub | SFXDate::SubDay | SFXDate::SubHour | SFXDate::SubMinute | SFXDate::SubMonth | SFXDate::SubSecond
[ public, static ] SFXDateConstRef ZeroInstance(Void);
The SFXDate::ZeroInstance function is the same as the constructor of SFXDate(0), but the SFXDate::ZeroInstance function is much faster.
[ public ] SFXDateRef operator=( SFXDateConstRef param // date to assign );
SFXDate::Set | operator== | operator> | operator>= | operator< | operator<= | operator!=
[ public, friend ] Bool operator==( SFXDateConstRef left // date to be compared SFXDateConstRef right // date to compare with );
SFXDate::operator= | operator> | operator>= | operator< | operator<= | operator!=
[ public, friend ] Bool operator>=( SFXDateConstRef left // date to be compared SFXDateConstRef right // date to compare with );
SFXDate::operator= | operator== | operator> | operator< | operator<= | operator!= |
[ public, friend ] Bool operator>( SFXDateConstRef left // date to be compared SFXDateConstRef right // date to compare with );
SFXDate::operator= | operator== | operator>= | operator< | operator<= | operator!=
[ public, friend ] Bool operator<=( SFXDateConstRef left // date to be compared SFXDateConstRef right // date to compare with );
SFXDate::operator= | operator== | operator> | operator>= | operator< | operator!=
[ public, friend ] Bool operator<( SFXDateConstRef left // date to be compared SFXDateConstRef right // date to compare with );
SFXDate::operator= | operator== | operator> | operator>= | operator<= | operator!=
[ public ] SFXDateRef operator-=( SFXDateDurationConstRef param // number of seconds to subtract );
[ public, friend ] SFXDate operator-( SFXDateConstRef left // date to be subtracted from SFXDateDurationConstRef right // date duration to subtract (SFXDateDuration) );
[ public, friend ] SFXDateDuration operator-( SFXDateConstRef left // date to be subtracted from SFXDateConstRef right // date/time to subtract (SFXDate) );
The second argument of the SFXDate type is considered to be an elapsed time in seconds since January 6, 1980 00:00:00, and is subtracted.
SFXDateDuration | SFXDate::operator-= | operator+ | SFXDate::operator+= | SFXDate::Sub
[ public, friend ] Bool operator!=( SFXDateConstRef left // date to be compared SFXDateConstRef right // date to compare with );
SFXDate::operator= | operator== | operator> | operator>= | operator< | operator<=
[ public ] SFXDateRef operator+=( SFXDateDurationConstRef param // date duration );
SFXDateDuration | operator- | SFXDate::operator-= | operator+
[ public, friend ] SFXDate operator+( SFXDateConstRef left // date SFXDateDurationConstRef right // date duration to add );
SFXDateDuration | operator- | SFXDate::operator-= | SFXDate::operator+=
enum DayOfWeekEnum { DAYOFWEEK_MONDAY = 0, DAYOFWEEK_TUESDAY, DAYOFWEEK_WEDNESDAY, DAYOFWEEK_THURSDAY, DAYOFWEEK_FRIDAY, DAYOFWEEK_SATURDAY, DAYOFWEEK_SUNDAY };
Mainly used by SFXDate::GetDayOfWeek function.
Meaning of the constant is as follows:
Constant (value) | Meaning |
---|---|
DAYOFWEEK_MONDAY (0) | Monday |
DAYOFWEEK_TUESDAY (1) | Tuesday |
DAYOFWEEK_WEDNESDAY (2) | Wednesday |
DAYOFWEEK_THURSDAY (3) | Thursday |
DAYOFWEEK_FRIDAY (4) | Friday |
DAYOFWEEK_SATURDAY (5) | Saturday |
DAYOFWEEK_SUNDAY (6) | Sunday |
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |