Public Member Functions | List of all members
FIX::UtcTimeStamp Class Reference

Date and Time represented in UTC. More...

#include <FieldTypes.h>

Inheritance diagram for FIX::UtcTimeStamp:
Inheritance graph
[legend]
Collaboration diagram for FIX::UtcTimeStamp:
Collaboration graph
[legend]

Public Member Functions

 UtcTimeStamp ()
 Defaults to the current date and time. More...
 
 UtcTimeStamp (int hour, int minute, int second, int millisecond=0)
 Defaults to the current date. More...
 
 UtcTimeStamp (int hour, int minute, int second, int date, int month, int year)
 
 UtcTimeStamp (int hour, int minute, int second, int millisecond, int date, int month, int year)
 
 UtcTimeStamp (time_t time, int millisecond=0)
 
 UtcTimeStamp (const tm *time, int millisecond=0)
 
void setCurrent ()
 
- Public Member Functions inherited from FIX::DateTime
 DateTime ()
 Default constructor - initializes to zero. More...
 
 DateTime (int date, int time)
 Construct from a Julian day number and time in millis. More...
 
 DateTime (int year, int month, int day, int hour, int minute, int second, int millis)
 Construct from the specified components. More...
 
virtual ~DateTime ()
 
int getYear () const
 Return the year portion of the date. More...
 
int getMonth () const
 Return the month (1-12) portion of the date. More...
 
int getDay () const
 Return the day of the month portion of the date. More...
 
int getDate () const
 Another name for the day of the month. More...
 
int getJulianDate () const
 Return the internal julian date. More...
 
int getHour () const
 Return the hour portion of the time (0-23) More...
 
int getMinute () const
 Return the minute portion of the time (0-59) More...
 
int getSecond () const
 Return the second portion of the time (0-59) More...
 
int getMillisecond () const
 Return the millisecond portion of the time. More...
 
void getYMD (int &year, int &month, int &day) const
 Load the referenced values with the year, month and day portions of the date in a single operation. More...
 
void getHMS (int &hour, int &minute, int &second, int &millis) const
 Load the referenced values with the hour, minute, second and millisecond portions of the time in a single operation. More...
 
int getWeekDay () const
 Calculate the weekday of the date (Sunday is 1, Saturday is 7) More...
 
time_t getTimeT () const
 Convert the DateTime to a time_t. More...
 
tm getTmUtc () const
 Convert the DateTime to a struct tm which is in UTC. More...
 
void setYMD (int year, int month, int day)
 Set the date portion of the DateTime. More...
 
void setHMS (int hour, int minute, int second, int millis)
 Set the time portion of the DateTime. More...
 
void setHour (int hour)
 Set the hour portion of the time. More...
 
void setMinute (int min)
 Set the minute portion of the time. More...
 
void setSecond (int sec)
 Set the seconds portion of the time. More...
 
void setMillisecond (int millis)
 Set the millisecond portion of the time. More...
 
void clearDate ()
 Clear the date portion of the DateTime. More...
 
void clearTime ()
 Clear the time portion of the DateTime. More...
 
void set (int date, int time)
 Set the internal date and time members. More...
 
void set (const DateTime &other)
 Initialize from another DateTime. More...
 
void operator+= (int seconds)
 Add a number of seconds to this. More...
 

Additional Inherited Members

- Public Types inherited from FIX::DateTime
enum  {
  SECONDS_PER_DAY = 86400, SECONDS_PER_HOUR = 3600, SECONDS_PER_MIN = 60, MINUTES_PER_HOUR = 60,
  MILLIS_PER_DAY = 86400000, MILLIS_PER_HOUR = 3600000, MILLIS_PER_MIN = 60000, MILLIS_PER_SEC = 1000,
  JULIAN_19700101 = 2440588
}
 Magic numbers. More...
 
- Static Public Member Functions inherited from FIX::DateTime
static int makeHMS (int hour, int minute, int second, int millis)
 Helper method to convert a broken down time to a number of milliseconds since midnight. More...
 
static DateTime nowUtc ()
 Return the current wall-clock time as a utc DateTime. More...
 
static DateTime nowLocal ()
 Return the current wall-clock time as a local DateTime. More...
 
static DateTime fromUtcTimeT (time_t t, int millis=0)
 Convert a time_t and optional milliseconds to a DateTime. More...
 
static DateTime fromLocalTimeT (time_t t, int millis=0)
 
static DateTime fromTm (const tm &tm, int millis=0)
 Convert a tm and optional milliseconds to a DateTime. More...
 
static int julianDate (int year, int month, int day)
 Helper method to calculate a Julian day number. More...
 
static void getYMD (int jday, int &year, int &month, int &day)
 Convert a Julian day number to a year, month and day. More...
 
- Public Attributes inherited from FIX::DateTime
int m_date
 
int m_time
 

Detailed Description

Date and Time represented in UTC.

Definition at line 399 of file FieldTypes.h.

Constructor & Destructor Documentation

FIX::UtcTimeStamp::UtcTimeStamp ( )
inline

Defaults to the current date and time.

Definition at line 403 of file FieldTypes.h.

404  : DateTime( DateTime::nowUtc() ) {}
DateTime()
Default constructor - initializes to zero.
Definition: FieldTypes.h:73
static DateTime nowUtc()
Return the current wall-clock time as a utc DateTime.
Definition: FieldTypes.cpp:34
FIX::UtcTimeStamp::UtcTimeStamp ( int  hour,
int  minute,
int  second,
int  millisecond = 0 
)
inline

Defaults to the current date.

Definition at line 407 of file FieldTypes.h.

References FIX::DateTime::setHMS().

409  {
410  setHMS( hour, minute, second, millisecond );
411  }
DateTime()
Default constructor - initializes to zero.
Definition: FieldTypes.h:73
static DateTime nowUtc()
Return the current wall-clock time as a utc DateTime.
Definition: FieldTypes.cpp:34
void setHMS(int hour, int minute, int second, int millis)
Set the time portion of the DateTime.
Definition: FieldTypes.h:211
FIX::UtcTimeStamp::UtcTimeStamp ( int  hour,
int  minute,
int  second,
int  date,
int  month,
int  year 
)
inline

Definition at line 413 of file FieldTypes.h.

415  : DateTime( year, month, date, hour, minute, second, 0 ) {}
DateTime()
Default constructor - initializes to zero.
Definition: FieldTypes.h:73
FIX::UtcTimeStamp::UtcTimeStamp ( int  hour,
int  minute,
int  second,
int  millisecond,
int  date,
int  month,
int  year 
)
inline

Definition at line 417 of file FieldTypes.h.

419  : DateTime( year, month, date, hour, minute, second, millisecond ) {}
DateTime()
Default constructor - initializes to zero.
Definition: FieldTypes.h:73
FIX::UtcTimeStamp::UtcTimeStamp ( time_t  time,
int  millisecond = 0 
)
inlineexplicit

Definition at line 421 of file FieldTypes.h.

422  : DateTime( fromUtcTimeT (time, millisecond) ) {}
static DateTime fromUtcTimeT(time_t t, int millis=0)
Convert a time_t and optional milliseconds to a DateTime.
Definition: FieldTypes.h:307
DateTime()
Default constructor - initializes to zero.
Definition: FieldTypes.h:73
FIX::UtcTimeStamp::UtcTimeStamp ( const tm *  time,
int  millisecond = 0 
)
inline

Definition at line 424 of file FieldTypes.h.

425  : DateTime( fromTm (*time, millisecond) ) {}
DateTime()
Default constructor - initializes to zero.
Definition: FieldTypes.h:73
static DateTime fromTm(const tm &tm, int millis=0)
Convert a tm and optional milliseconds to a DateTime.
Definition: FieldTypes.h:321

Member Function Documentation

void FIX::UtcTimeStamp::setCurrent ( )
inline

Definition at line 427 of file FieldTypes.h.

References FIX::DateTime::nowUtc(), and FIX::DateTime::set().

Referenced by FIX::ScreenLog::onEvent(), FIX::ScreenLog::onIncoming(), FIX::ScreenLog::onOutgoing(), and FIX::NullStore::reset().

428  {
429  set( DateTime::nowUtc() );
430  }
static DateTime nowUtc()
Return the current wall-clock time as a utc DateTime.
Definition: FieldTypes.cpp:34
void set(int date, int time)
Set the internal date and time members.
Definition: FieldTypes.h:261

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

Generated on Sat Mar 29 2014 15:13:34 for QuickFIX by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2001