CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
OdTimeStamp Class Reference

#include <OdTimeStamp.h>

Inheritance diagram for OdTimeStamp:
OdDbDate

Public Types

enum  InitialValue { kInitZero = 1 , kInitLocalTime = 2 , kInitUniversalTime = 3 }
 

Public Member Functions

 OdTimeStamp ()
 
 OdTimeStamp (InitialValue init)
 
void getDate (short &month, short &day, short &year) const
 
void setDate (short month, short day, short year)
 
short month () const
 
void setMonth (short month)
 
short day () const
 
void setDay (short day)
 
short year () const
 
void setYear (short year)
 
void getTime (short &hour, short &minute, short &second, short &millisecond) const
 
void setTime (short hour, short minute, short second, short millisecond)
 
short hour () const
 
void setHour (short hour)
 
short minute () const
 
void setMinute (short minute)
 
short second () const
 
void setSecond (short second)
 
short millisecond () const
 
void setMillisecond (short millisecond)
 
void setToZero ()
 
void getLocalTime ()
 
void getUniversalTime ()
 
void localToUniversal ()
 
void universalToLocal ()
 
OdUInt32 julianDay () const
 
void setJulianDay (OdUInt32 julianDay)
 
OdUInt32 msecsPastMidnight () const
 
void setMsecsPastMidnight (OdUInt32 msecsPastMidnight)
 
void setJulianDate (OdUInt32 julianDay, OdUInt32 msecsPastMidnight)
 
double julianFraction () const
 
void setJulianFraction (double julianFraction)
 
bool operator== (const OdTimeStamp &tStamp) const
 
bool operator!= (const OdTimeStamp &tStamp) const
 
bool operator> (const OdTimeStamp &tStamp) const
 
bool operator>= (const OdTimeStamp &tStamp) const
 
bool operator< (const OdTimeStamp &tStamp) const
 
bool operator<= (const OdTimeStamp &tStamp) const
 
const OdTimeStamp operator+ (const OdTimeStamp &tStamp) const
 
const OdTimeStamp operator- (const OdTimeStamp &tStamp) const
 
const OdTimeStampoperator+= (const OdTimeStamp &tStamp)
 
const OdTimeStampoperator-= (const OdTimeStamp &tStamp)
 
const OdTimeStampadd (const OdTimeStamp &tStamp)
 
const OdTimeStampsubtract (const OdTimeStamp &tStamp)
 
void ctime (class OdString &timeString) const
 
void strftime (const OdString &format, OdString &timeString) const
 
OdInt64 packedValue () const
 
void setPackedValue (OdInt64 t)
 
short weekday () const
 

Detailed Description

This class represents TimeStamp objects in an OdDbDatabase instance.

See also
TD_Db

<group Other_Classes>

Definition at line 41 of file OdTimeStamp.h.

Member Enumeration Documentation

◆ InitialValue

Enumerator
kInitZero 
kInitLocalTime 
kInitUniversalTime 

Definition at line 44 of file OdTimeStamp.h.

Constructor & Destructor Documentation

◆ OdTimeStamp() [1/2]

OdTimeStamp::OdTimeStamp ( )
Parameters
init[in] Initial value.
Remarks
The default constructor initializes the Julian date and time to midnight, January 1, 1970, UTC.

init must be one of the following:

Value Description kInitZero 1 Midnight, January 1, 1970, UTC. kInitLocalTime 2 Workstation date in local time. kInitUniversalTime 3 Workstation date in Universal (Greenwich Mean) Time.

◆ OdTimeStamp() [2/2]

OdTimeStamp::OdTimeStamp ( InitialValue  init)

Member Function Documentation

◆ add()

const OdTimeStamp & OdTimeStamp::add ( const OdTimeStamp tStamp)
inline

Adds the specified TimeStamp object to this TimeStamp object, and returns the sum.

Parameters
tStamp[in] TimeStamp.

Definition at line 328 of file OdTimeStamp.h.

◆ ctime()

void OdTimeStamp::ctime ( class OdString timeString) const

Returns this TimeStamp object as standard formatted string.

Parameters
timeString[out] Receives the formatted time string.
Remarks
The returned string is always 24 characters in length, and is in the form
          Tue Oct 11 08:06:22 2005

◆ day()

short OdTimeStamp::day ( ) const

Returns the day of this TimeStamp object.

◆ getDate()

void OdTimeStamp::getDate ( short &  month,
short &  day,
short &  year 
) const

Returns the date of this TimeStamp object.

Parameters
month[out] Receives the month.
day[out] Receives the day.
year[out] Receives the year.

◆ getLocalTime()

void OdTimeStamp::getLocalTime ( )

Sets this TimeStamp object to the workstation date in local time.

◆ getTime()

void OdTimeStamp::getTime ( short &  hour,
short &  minute,
short &  second,
short &  millisecond 
) const

Returns the time of this TimeStamp object.

Parameters
hour[out] Receives the hour.
minute[out] Receives the minute.
second[out] Receives the second.
millisecond[out] Receives the millisecond.

◆ getUniversalTime()

void OdTimeStamp::getUniversalTime ( )

Sets this TimeStamp object to the workstation date in Universal (Greenwich Mean) Time.

◆ hour()

short OdTimeStamp::hour ( ) const

Returns the hour of this TimeStamp object.

◆ julianDay()

OdUInt32 OdTimeStamp::julianDay ( ) const

Returns the Julian day of this TimeStamp object.

◆ julianFraction()

double OdTimeStamp::julianFraction ( ) const

Returns the fraction of the Julian date of this TimeStamp object.

Remarks
The Julian fraction is the fraction of the day since midnight.

◆ localToUniversal()

void OdTimeStamp::localToUniversal ( )

Converts this TimeStamp object from local time to Universal (Greenwich Mean) Time.

◆ millisecond()

short OdTimeStamp::millisecond ( ) const

Returns the millisecond of this TimeStamp object.

◆ minute()

short OdTimeStamp::minute ( ) const

Returns the minute of this TimeStamp object.

◆ month()

short OdTimeStamp::month ( ) const

Returns the month of this TimeStamp object.

◆ msecsPastMidnight()

OdUInt32 OdTimeStamp::msecsPastMidnight ( ) const

Returns the milliseconds past midnight for this TimeStamp object.

◆ operator!=()

bool OdTimeStamp::operator!= ( const OdTimeStamp tStamp) const
inline

Definition at line 281 of file OdTimeStamp.h.

◆ operator+()

const OdTimeStamp OdTimeStamp::operator+ ( const OdTimeStamp tStamp) const
inline

Definition at line 305 of file OdTimeStamp.h.

◆ operator+=()

const OdTimeStamp & OdTimeStamp::operator+= ( const OdTimeStamp tStamp)

◆ operator-()

const OdTimeStamp OdTimeStamp::operator- ( const OdTimeStamp tStamp) const
inline

Definition at line 311 of file OdTimeStamp.h.

◆ operator-=()

const OdTimeStamp & OdTimeStamp::operator-= ( const OdTimeStamp tStamp)

◆ operator<()

bool OdTimeStamp::operator< ( const OdTimeStamp tStamp) const

◆ operator<=()

bool OdTimeStamp::operator<= ( const OdTimeStamp tStamp) const
inline

Definition at line 299 of file OdTimeStamp.h.

◆ operator==()

bool OdTimeStamp::operator== ( const OdTimeStamp tStamp) const

◆ operator>()

bool OdTimeStamp::operator> ( const OdTimeStamp tStamp) const

◆ operator>=()

bool OdTimeStamp::operator>= ( const OdTimeStamp tStamp) const
inline

Definition at line 290 of file OdTimeStamp.h.

◆ packedValue()

OdInt64 OdTimeStamp::packedValue ( ) const

Returns this TimeStamp object as long.

Remarks
packedValue returns the number of seconds elapsed since midnight, January 1, 1970, Universal (Greenwich Mean) Time.

If this TimeStamp object contains a date before midnight, January 1, 1970, UTC, or after 3:14:07 on January 19, 2038, UT, packedValue() returns -1.

◆ second()

short OdTimeStamp::second ( ) const

Returns the second of this TimeStamp object.

◆ setDate()

void OdTimeStamp::setDate ( short  month,
short  day,
short  year 
)

Sets the date of this TimeStamp object.

Parameters
month[in] Month.
day[in] Day.
year[in] Year.

◆ setDay()

void OdTimeStamp::setDay ( short  day)

Sets the day of this TimeStamp object.

Parameters
day[in] Day.

◆ setHour()

void OdTimeStamp::setHour ( short  hour)

Sets the hour of this TimeStamp object.

Parameters
hour[in] Hour.

◆ setJulianDate()

void OdTimeStamp::setJulianDate ( OdUInt32  julianDay,
OdUInt32  msecsPastMidnight 
)

Sets the Julian Date for this TimeStamp object.

Parameters
julianDay[in] Julian day.
msecsPastMidnight[in] Milliseconds past midnight.

◆ setJulianDay()

void OdTimeStamp::setJulianDay ( OdUInt32  julianDay)

Sets the Julian day of this TimeStamp object.

Parameters
julianDay[in] Julian day.

◆ setJulianFraction()

void OdTimeStamp::setJulianFraction ( double  julianFraction)

Sets the fraction of the Julian date of this TimeStamp object.

Parameters
julianFraction[in] Julian fraction.
Remarks
The Julian fraction is the fraction of the day since midnight.

◆ setMillisecond()

void OdTimeStamp::setMillisecond ( short  millisecond)

Sets the millisecond of this TimeStamp object.

Parameters
millisecond[in] Millisecond.

◆ setMinute()

void OdTimeStamp::setMinute ( short  minute)

Sets the minute of this TimeStamp object.

Parameters
minute[in] Minute.

◆ setMonth()

void OdTimeStamp::setMonth ( short  month)

Sets the month of this TimeStamp object.

Parameters
month[in] Month.

◆ setMsecsPastMidnight()

void OdTimeStamp::setMsecsPastMidnight ( OdUInt32  msecsPastMidnight)

Sets the milliseconds past midnight for this TimeStamp object.

Parameters
msecsPastMidnight[in] Milliseconds past midnight.

◆ setPackedValue()

void OdTimeStamp::setPackedValue ( OdInt64  t)

◆ setSecond()

void OdTimeStamp::setSecond ( short  second)

Sets the second of this TimeStamp object.

Parameters
second[in] Second.

◆ setTime()

void OdTimeStamp::setTime ( short  hour,
short  minute,
short  second,
short  millisecond 
)

Sets the time of this TimeStamp object.

Parameters
hour[in] Hour.
minute[in] Minute.
second[in] Second.
millisecond[in] Millisecond.

◆ setToZero()

void OdTimeStamp::setToZero ( )

Sets this TimeStamp object to Midnight, January 1, 1970, UTC.

◆ setYear()

void OdTimeStamp::setYear ( short  year)

Sets the year of this TimeStamp object.

Parameters
year[in] Year.

◆ strftime()

void OdTimeStamp::strftime ( const OdString format,
OdString timeString 
) const

Returns this TimeStamp object as a user-formatted string.

Parameters
timeString[out] Receives the formatted time string.
format[in] Format string.
Remarks
The formatting codes for the format string are as follows; the # suppresses leading zeros:

Description a Short weekday A Full weekday b Short month B Full month c Short date and time for current locale %#c Long date and time for current locale d Day of month (01 - 31) %#d Day of month (1 - 31) H Hour in 24 hour format (00 - 23) %#H Hour in 24 hour format (0 - 23) I Hour in 12 hour format (01 - 12) %#I Hour in 12 hour format (1 - 12) j Day of year (001 - 366) %#j Day of year (1 - 366) m Month (01 - 12) %#m Month (1 - 12) M Minute (00 - 59) %#M Minute (0 - 59) p AM/PM indicator for current local S Second (00 - 59) %#S Second (0 - 59) U Week of the year, first day of week is Sunday (00 - 53) %#U Week of the year, first day of week is Sunday (0 - 53) w Weekday, Sunday is 0, (0 - 6) %w Weekday, Sunday is 0, (0 - 6) W Week of the year, first day of week is Monday (00 - 53) %#W Week of the year, first day of week is Monday (0 - 53) x Date for the current locale X Time for the current locale y Year without century (00 - 99) %y Year without century (0 - 99) Y Year with century
Y Year with century, no leading zeros z Time-zone name
Z Time zone abbreviation

◆ subtract()

const OdTimeStamp & OdTimeStamp::subtract ( const OdTimeStamp tStamp)
inline

Subtracts the specified TimeStamp object from this TimeStamp object, and returns the difference.

Parameters
tStamp[in] TimeStamp.

Definition at line 339 of file OdTimeStamp.h.

◆ universalToLocal()

void OdTimeStamp::universalToLocal ( )

Converts this TimeStamp object from Universal (Greenwich Mean) Time to local time.

◆ weekday()

short OdTimeStamp::weekday ( ) const

◆ year()

short OdTimeStamp::year ( ) const

Returns the year of this TimeStamp object.


The documentation for this class was generated from the following file: