Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
FIX::DateTime Struct Reference

#include <FieldTypes.h>

Inheritance diagram for FIX::DateTime:
Inheritance graph
[legend]

Public Member Functions

 DateTime ()
 Default constructor - initializes to zero. More...
 
 DateTime (int date, int64_t 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...
 
 DateTime (int year, int month, int day, int hour, int minute, int second, int fraction, int precision)
 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 (0-999) More...
 
int getMicroecond () const
 Return the microsecond portion of the time. More...
 
unsigned int getNanosecond () const
 Return the nanosecond portion of the time. More...
 
int getFraction (int precision) const
 Return the fraction 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...
 
void getHMS (int &hour, int &minute, int &second, int &fraction, int precision) const
 Load the referenced values with the hour, minute, second and fraction 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 setHMS (int hour, int minute, int second, int fraction, int precision)
 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 setMicrosecond (int micros)
 Set the microsecond portion of the time. More...
 
void setNanosecond (int nanos)
 Set the nanosecond portion of the time. More...
 
void setFraction (int fraction, int precision)
 Set the fraction 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, int64_t 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...
 

Static Public Member Functions

static int convertToNanos (int fraction, int precision)
 Convert to internal nanos. More...
 
static int64_t makeHMS (int hour, int minute, int second, int nanos)
 Helper method to convert a broken down time to a number of nanoseconds 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 fromUtcTimeT (time_t t, int fraction, int precision)
 
static DateTime fromLocalTimeT (time_t t, int fraction, int precision)
 
static DateTime fromTm (const tm &tm, int millis=0)
 Convert a tm and optional milliseconds to a DateTime. More...
 
static DateTime fromTm (const tm &tm, int fraction, int precision)
 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

int m_date
 
int64_t m_time
 

Static Public Attributes

static const int64_t SECONDS_PER_DAY = 86400
 Magic numbers. More...
 
static const int64_t SECONDS_PER_HOUR = 3600
 
static const int64_t SECONDS_PER_MIN = 60
 
static const int64_t MINUTES_PER_HOUR = 60
 
static const int64_t NANOS_PER_DAY = 86400000000000
 
static const int64_t NANOS_PER_HOUR = 3600000000000
 
static const int64_t NANOS_PER_MIN = 60000000000
 
static const int64_t NANOS_PER_SEC = 1000000000
 
static const int64_t JULIAN_19700101 = 2440588
 

Detailed Description

Definition at line 75 of file FieldTypes.h.

Constructor & Destructor Documentation

◆ DateTime() [1/4]

FIX::DateTime::DateTime ( )
inline

Default constructor - initializes to zero.

Definition at line 95 of file FieldTypes.h.

96 {

References julianDate(), and m_date.

Referenced by fromUtcTimeT(), and FIX::operator>=().

◆ DateTime() [2/4]

FIX::DateTime::DateTime ( int  date,
int64_t  time 
)
inline

Construct from a Julian day number and time in millis.

Definition at line 98 of file FieldTypes.h.

102 {}

◆ DateTime() [3/4]

FIX::DateTime::DateTime ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second,
int  millis 
)
inline

Construct from the specified components.

Definition at line 101 of file FieldTypes.h.

102  {}
103 
105  inline int getYear() const
106  {

◆ DateTime() [4/4]

FIX::DateTime::DateTime ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second,
int  fraction,
int  precision 
)
inline

Construct from the specified components.

Definition at line 109 of file FieldTypes.h.

114  {
115  int y, m, d;

◆ ~DateTime()

virtual FIX::DateTime::~DateTime ( )
inlinevirtual

Definition at line 117 of file FieldTypes.h.

122 {

Member Function Documentation

◆ clearDate()

void FIX::DateTime::clearDate ( )
inline

Clear the date portion of the DateTime.

Definition at line 373 of file FieldTypes.h.

374  {
375  m_date = other.m_date;
376  m_time = other.m_time;

References m_date, and m_time.

Referenced by FIX::LocalTimeOnly::LocalTimeOnly(), FIX::LocalTimeStamp::setCurrent(), and FIX::UtcTimeOnly::UtcTimeOnly().

◆ clearTime()

void FIX::DateTime::clearTime ( )
inline

Clear the time portion of the DateTime.

Definition at line 379 of file FieldTypes.h.

381  {
382  int d = seconds / SECONDS_PER_DAY;

◆ convertToNanos()

static int FIX::DateTime::convertToNanos ( int  fraction,
int  precision 
)
inlinestatic

Convert to internal nanos.

Definition at line 416 of file FieldTypes.h.

419  :
420  nanos = fraction * PRECISION_FACTOR[3];
421  break;
422 
423  case 4:
424  nanos = fraction * PRECISION_FACTOR[4];
425  break;
426 
427  case 5:
428  nanos = fraction * PRECISION_FACTOR[5];
429  break;
430 
431  case 6:
432  nanos = fraction * PRECISION_FACTOR[6];
433  break;
434 
435  case 7:
436  nanos = fraction * PRECISION_FACTOR[7];
437  break;
438 
439  case 8:
440  nanos = fraction * PRECISION_FACTOR[8];
441  break;
442 
443  case 9:
444  default:
445  nanos = fraction * PRECISION_FACTOR[9];
446  break;
447  }
448 
449  return nanos;
450  }
451 
454  static int64_t makeHMS( int hour, int minute, int second, int nanos )
455  {
456  return NANOS_PER_SEC * (SECONDS_PER_HOUR * hour +
457  SECONDS_PER_MIN * minute +
458  second) + nanos;
459  }
460 
462  static DateTime nowUtc();
463 
465  static DateTime nowLocal();

◆ fromLocalTimeT() [1/2]

static DateTime FIX::DateTime::fromLocalTimeT ( time_t  t,
int  fraction,
int  precision 
)
inlinestatic

Definition at line 501 of file FieldTypes.h.

504  {
505  int nanos = convertToNanos(fraction, precision);

◆ fromLocalTimeT() [2/2]

static DateTime FIX::DateTime::fromLocalTimeT ( time_t  t,
int  millis = 0 
)
inlinestatic

Definition at line 489 of file FieldTypes.h.

495  {

Referenced by nowUtc().

◆ fromTm() [1/2]

static DateTime FIX::DateTime::fromTm ( const tm &  tm,
int  fraction,
int  precision 
)
inlinestatic

Convert a tm and optional milliseconds to a DateTime.

Note
the tm structure is assumed to contain a date specified in UTC

Definition at line 518 of file FieldTypes.h.

523  {
524  int a = jday + 32044;

◆ fromTm() [2/2]

static DateTime FIX::DateTime::fromTm ( const tm &  tm,
int  millis = 0 
)
inlinestatic

Convert a tm and optional milliseconds to a DateTime.

Note
the tm structure is assumed to contain a date specified in UTC

Definition at line 509 of file FieldTypes.h.

513  {
514  int a = (14 - month) / 12;

Referenced by makeHMS().

◆ fromUtcTimeT() [1/2]

static DateTime FIX::DateTime::fromUtcTimeT ( time_t  t,
int  fraction,
int  precision 
)
inlinestatic

Definition at line 495 of file FieldTypes.h.

495  {
496  return DateTime ( julianDate(tm.tm_year + 1900, tm.tm_mon + 1,
497  tm.tm_mday),
498  makeHMS(tm.tm_hour, tm.tm_min, tm.tm_sec, millis * PRECISION_FACTOR[3]) );
499  }

References DateTime(), julianDate(), makeHMS(), and FIX::PRECISION_FACTOR.

◆ fromUtcTimeT() [2/2]

static DateTime FIX::DateTime::fromUtcTimeT ( time_t  t,
int  millis = 0 
)
inlinestatic

Convert a time_t and optional milliseconds to a DateTime.

Definition at line 483 of file FieldTypes.h.

487  {

◆ getDate()

int FIX::DateTime::getDate ( ) const
inline

Another name for the day of the month.

Bad name, but used because of the legacy UtcTimeStamp interface

Definition at line 145 of file FieldTypes.h.

149 {

◆ getDay()

int FIX::DateTime::getDay ( ) const
inline

Return the day of the month portion of the date.

Definition at line 136 of file FieldTypes.h.

137  {
138  return (int)(m_time / NANOS_PER_HOUR);
139  }
140 

References m_time, and NANOS_PER_HOUR.

◆ getFraction()

int FIX::DateTime::getFraction ( int  precision) const
inline

Return the fraction portion of the time.

Definition at line 187 of file FieldTypes.h.

188  :
189  return (getNanosecond() / PRECISION_FACTOR[4]);
190 
191  case 5:
192  return (getNanosecond() / PRECISION_FACTOR[5]);
193 
194  case 6:
195  return (getNanosecond() / PRECISION_FACTOR[6]);
196 
197  case 7:
198  return (getNanosecond() / PRECISION_FACTOR[7]);
199 
200  case 8:
201  return (getNanosecond() / PRECISION_FACTOR[8]);
202 
203  case 9:
204  default:
205  return (getNanosecond() / PRECISION_FACTOR[9]);
206  }
207  }
208 
211  inline void getYMD (int& year, int& month, int& day) const
212  {
213  getYMD( m_date, year, month, day );
214  }
215 
218  inline void getHMS( int& hour, int& minute, int& second, int& millis ) const
219  {
220  int ticks = (int)(m_time / NANOS_PER_SEC);
221  hour = ticks / SECONDS_PER_HOUR;
222  minute = (ticks / SECONDS_PER_MIN) % MINUTES_PER_HOUR;

◆ getHMS() [1/2]

void FIX::DateTime::getHMS ( int &  hour,
int &  minute,
int &  second,
int &  fraction,
int  precision 
) const
inline

Load the referenced values with the hour, minute, second and fraction portions of the time in a single operation.

Definition at line 244 of file FieldTypes.h.

244  : Y - 1;
245  int y = Yprime % 100;
246  int c = Yprime / 100;
247  int wd = (D + int (2.6 * m - 0.2) + y + int (y / 4) + int (c / 4) -
248  (2 * c)) % 7;
249  return 1 + (wd < 0 ? 7 + wd : wd);
250  }
251 

◆ getHMS() [2/2]

void FIX::DateTime::getHMS ( int &  hour,
int &  minute,
int &  second,
int &  millis 
) const
inline

Load the referenced values with the hour, minute, second and millisecond portions of the time in a single operation.

Definition at line 233 of file FieldTypes.h.

240  {

Referenced by setHMS().

◆ getHour()

int FIX::DateTime::getHour ( ) const
inline

Return the hour portion of the time (0-23)

Definition at line 151 of file FieldTypes.h.

155  {

◆ getJulianDate()

int FIX::DateTime::getJulianDate ( ) const
inline

Return the internal julian date.

Definition at line 148 of file FieldTypes.h.

149 {

References m_time, NANOS_PER_SEC, and SECONDS_PER_MIN.

◆ getMicroecond()

int FIX::DateTime::getMicroecond ( ) const
inline

Return the microsecond portion of the time.

Definition at line 175 of file FieldTypes.h.

175  {
176  case 0:
177  return (getNanosecond() / PRECISION_FACTOR[0]);
178 

References getNanosecond(), and FIX::PRECISION_FACTOR.

◆ getMillisecond()

int FIX::DateTime::getMillisecond ( ) const
inline

Return the millisecond portion of the time (0-999)

Definition at line 169 of file FieldTypes.h.

173  {

◆ getMinute()

int FIX::DateTime::getMinute ( ) const
inline

Return the minute portion of the time (0-59)

Definition at line 157 of file FieldTypes.h.

161  {

◆ getMonth()

int FIX::DateTime::getMonth ( ) const
inline

Return the month (1-12) portion of the date.

Definition at line 128 of file FieldTypes.h.

130  { return getDay(); }
131 
133  inline int getJulianDate() const { return m_date; }

◆ getNanosecond()

unsigned int FIX::DateTime::getNanosecond ( ) const
inline

Return the nanosecond portion of the time.

Definition at line 181 of file FieldTypes.h.

182  :
183  return (getNanosecond() / PRECISION_FACTOR[2]);
184 

Referenced by getMicroecond().

◆ getSecond()

int FIX::DateTime::getSecond ( ) const
inline

Return the second portion of the time (0-59)

Definition at line 163 of file FieldTypes.h.

167  {

◆ getTimeT()

time_t FIX::DateTime::getTimeT ( ) const
inline

Convert the DateTime to a time_t.

Note that this operation can overflow on 32-bit platforms when we go beyond year 2038.

Definition at line 269 of file FieldTypes.h.

283  {

Referenced by FIX::TimeRange::isInRange().

◆ getTmUtc()

tm FIX::DateTime::getTmUtc ( ) const
inline

Convert the DateTime to a struct tm which is in UTC.

Definition at line 276 of file FieldTypes.h.

283  {
284  m_date = julianDate( year, month, day );
285  }
286 
288  void setHMS( int hour, int minute, int second, int millis )
289  {
290  m_time = makeHMS( hour, minute, second, millis * PRECISION_FACTOR[3] );
291  }
292 
294  void setHMS( int hour, int minute, int second, int fraction, int precision )

◆ getWeekDay()

int FIX::DateTime::getWeekDay ( ) const
inline

Calculate the weekday of the date (Sunday is 1, Saturday is 7)

Definition at line 254 of file FieldTypes.h.

255  {
256  return (SECONDS_PER_DAY * (m_date - JULIAN_19700101) +
258  }
259 
261  tm getTmUtc() const
262  {
263  int year, month, day;
264  int hour, minute, second, millis;
265  tm result = { 0 };

References JULIAN_19700101, m_date, m_time, NANOS_PER_SEC, and SECONDS_PER_DAY.

◆ getYear()

int FIX::DateTime::getYear ( ) const
inline

Return the year portion of the date.

Definition at line 120 of file FieldTypes.h.

122  {
123  int y, m, d;
124  getYMD( y, m, d );
125  return d;

◆ getYMD() [1/2]

void FIX::DateTime::getYMD ( int &  year,
int &  month,
int &  day 
) const
inline

Load the referenced values with the year, month and day portions of the date in a single operation.

Definition at line 226 of file FieldTypes.h.

230  {

References m_time, NANOS_PER_SEC, and SECONDS_PER_HOUR.

◆ getYMD() [2/2]

static void FIX::DateTime::getYMD ( int  jday,
int &  year,
int &  month,
int &  day 
)
inlinestatic

Convert a Julian day number to a year, month and day.

Definition at line 537 of file FieldTypes.h.

537 {
538  return lhs.m_date == rhs.m_date && lhs.m_time == rhs.m_time;
539 }
540 
541 inline bool operator!=( const DateTime& lhs, const DateTime& rhs )
542 {
543  return !(lhs == rhs);
544 }
545 
546 inline bool operator<( const DateTime& lhs, const DateTime& rhs )
547 {
548  if( lhs.m_date < rhs.m_date )

◆ julianDate()

static int FIX::DateTime::julianDate ( int  year,
int  month,
int  day 
)
inlinestatic

Helper method to calculate a Julian day number.

Definition at line 527 of file FieldTypes.h.

537 {

Referenced by DateTime(), and fromUtcTimeT().

◆ makeHMS()

static int64_t FIX::DateTime::makeHMS ( int  hour,
int  minute,
int  second,
int  nanos 
)
inlinestatic

Helper method to convert a broken down time to a number of nanoseconds since midnight.

Definition at line 469 of file FieldTypes.h.

469  {
470  struct tm tm = time_gmtime( &t );
471  return fromTm( tm, millis );
472  }
473 
474  static DateTime fromLocalTimeT( time_t t, int millis = 0 )

References fromTm(), and FIX::time_gmtime().

Referenced by fromUtcTimeT().

◆ nowLocal()

DateTime FIX::DateTime::nowLocal ( )
static

Return the current wall-clock time as a local DateTime.

Definition at line 64 of file FieldTypes.cpp.

Referenced by FIX::LocalTimeStamp::LocalTimeStamp().

◆ nowUtc()

DateTime FIX::DateTime::nowUtc ( )
static

Return the current wall-clock time as a utc DateTime.

Definition at line 49 of file FieldTypes.cpp.

50 {
51 #if defined( _POSIX_SOURCE ) || defined(HAVE_GETTIMEOFDAY)
52  struct timeval tv;
53  gettimeofday (&tv, 0);
54  return fromLocalTimeT( tv.tv_sec, tv.tv_usec, 6 );
55 #elif defined( HAVE_FTIME )
56  timeb tb;
57  ftime (&tb);
58  return fromLocalTimeT( tb.time, tb.millitm );
59 #else
60  return fromLocalTimeT( ::time (0), 0 );
61 #endif
62 }

References fromLocalTimeT().

Referenced by FIX::operator>=(), and FIX::UtcTimeStamp::UtcTimeStamp().

◆ operator+=()

void FIX::DateTime::operator+= ( int  seconds)
inline

Add a number of seconds to this.

Definition at line 395 of file FieldTypes.h.

402  {
403  int nanos;
404 
405  switch (precision)
406  {
407  case 0:
408  nanos = fraction * PRECISION_FACTOR[0];
409  break;
410 
411  case 1:
412  nanos = fraction * PRECISION_FACTOR[1];
413  break;

◆ set() [1/2]

void FIX::DateTime::set ( const DateTime other)
inline

Initialize from another DateTime.

Definition at line 388 of file FieldTypes.h.

389  {
390  m_date++;
392  }

References m_date, m_time, and NANOS_PER_DAY.

◆ set() [2/2]

void FIX::DateTime::set ( int  date,
int64_t  time 
)
inline

Set the internal date and time members.

Definition at line 385 of file FieldTypes.h.

389 {

Referenced by FIX::LocalTimeStamp::LocalTimeStamp(), and FIX::UtcTimeStamp::UtcTimeStamp().

◆ setFraction()

void FIX::DateTime::setFraction ( int  fraction,
int  precision 
)
inline

Set the fraction portion of the time.

Definition at line 365 of file FieldTypes.h.

365  {
366  m_time = 0;
367  }
368 
370  void set( int date, int64_t time ) { m_date = date; m_time = time; }

References m_time.

◆ setHMS() [1/2]

void FIX::DateTime::setHMS ( int  hour,
int  minute,
int  second,
int  fraction,
int  precision 
)
inline

Set the time portion of the DateTime.

Definition at line 309 of file FieldTypes.h.

311  {
312  int hour, old_min, sec, millis;
313  getHMS( hour, old_min, sec, millis );
314  setHMS( hour, min, sec, millis );

◆ setHMS() [2/2]

void FIX::DateTime::setHMS ( int  hour,
int  minute,
int  second,
int  millis 
)
inline

Set the time portion of the DateTime.

Definition at line 303 of file FieldTypes.h.

303  {
304  int old_hour, min, sec, millis;
305  getHMS( old_hour, min, sec, millis );
306  setHMS( hour, min, sec, millis );

References getHMS().

Referenced by FIX::LocalTimeOnly::LocalTimeOnly(), FIX::operator>=(), FIX::UtcTimeStamp::setCurrent(), and FIX::UtcTimeOnly::UtcTimeOnly().

◆ setHour()

void FIX::DateTime::setHour ( int  hour)
inline

Set the hour portion of the time.

Definition at line 317 of file FieldTypes.h.

319  {
320  int hour, min, old_sec, millis;
321  getHMS( hour, min, old_sec, millis );
322  setHMS( hour, min, sec, millis );

◆ setMicrosecond()

void FIX::DateTime::setMicrosecond ( int  micros)
inline

Set the microsecond portion of the time.

Definition at line 349 of file FieldTypes.h.

351  {
352  int hour, min, sec, old_nanos;
353  getHMS( hour, min, sec, old_nanos, 9 );
354  setHMS( hour, min, sec, fraction, precision );

◆ setMillisecond()

void FIX::DateTime::setMillisecond ( int  millis)
inline

Set the millisecond portion of the time.

Definition at line 341 of file FieldTypes.h.

343  {
344  int hour, min, sec, old_nanos;
345  getHMS( hour, min, sec, old_nanos, 9 );
346  setHMS( hour, min, sec, nanos, 9 );

◆ setMinute()

void FIX::DateTime::setMinute ( int  min)
inline

Set the minute portion of the time.

Definition at line 325 of file FieldTypes.h.

327  {
328  int hour, min, sec, old_millis;
329  getHMS( hour, min, sec, old_millis );
330  setHMS( hour, min, sec, millis );

◆ setNanosecond()

void FIX::DateTime::setNanosecond ( int  nanos)
inline

Set the nanosecond portion of the time.

Definition at line 357 of file FieldTypes.h.

359  {
360  m_date = 0;
361  }
362 

◆ setSecond()

void FIX::DateTime::setSecond ( int  sec)
inline

Set the seconds portion of the time.

Definition at line 333 of file FieldTypes.h.

335  {
336  int hour, min, sec, old_nanos;
337  getHMS( hour, min, sec, old_nanos, 9 );
338  setHMS( hour, min, sec, micros, 6 );

◆ setYMD()

void FIX::DateTime::setYMD ( int  year,
int  month,
int  day 
)
inline

Set the date portion of the DateTime.

Definition at line 297 of file FieldTypes.h.

303  {

Member Data Documentation

◆ JULIAN_19700101

const int64_t FIX::DateTime::JULIAN_19700101 = 2440588
static

Definition at line 92 of file FieldTypes.h.

Referenced by getWeekDay().

◆ m_date

int FIX::DateTime::m_date

Definition at line 77 of file FieldTypes.h.

Referenced by clearDate(), DateTime(), getWeekDay(), and set().

◆ m_time

int64_t FIX::DateTime::m_time

Definition at line 78 of file FieldTypes.h.

Referenced by clearDate(), getDay(), getJulianDate(), getWeekDay(), getYMD(), set(), and setFraction().

◆ MINUTES_PER_HOUR

const int64_t FIX::DateTime::MINUTES_PER_HOUR = 60
static

Definition at line 84 of file FieldTypes.h.

◆ NANOS_PER_DAY

const int64_t FIX::DateTime::NANOS_PER_DAY = 86400000000000
static

Definition at line 86 of file FieldTypes.h.

Referenced by set().

◆ NANOS_PER_HOUR

const int64_t FIX::DateTime::NANOS_PER_HOUR = 3600000000000
static

Definition at line 87 of file FieldTypes.h.

Referenced by getDay().

◆ NANOS_PER_MIN

const int64_t FIX::DateTime::NANOS_PER_MIN = 60000000000
static

Definition at line 88 of file FieldTypes.h.

◆ NANOS_PER_SEC

const int64_t FIX::DateTime::NANOS_PER_SEC = 1000000000
static

Definition at line 89 of file FieldTypes.h.

Referenced by getJulianDate(), getWeekDay(), and getYMD().

◆ SECONDS_PER_DAY

const int64_t FIX::DateTime::SECONDS_PER_DAY = 86400
static

Magic numbers.

Definition at line 81 of file FieldTypes.h.

Referenced by getWeekDay().

◆ SECONDS_PER_HOUR

const int64_t FIX::DateTime::SECONDS_PER_HOUR = 3600
static

Definition at line 82 of file FieldTypes.h.

Referenced by getYMD().

◆ SECONDS_PER_MIN

const int64_t FIX::DateTime::SECONDS_PER_MIN = 60
static

Definition at line 83 of file FieldTypes.h.

Referenced by getJulianDate().


The documentation for this struct was generated from the following files:
FIX::DateTime::getDay
int getDay() const
Return the day of the month portion of the date.
Definition: FieldTypes.h:136
FIX::DateTime::NANOS_PER_SEC
static const int64_t NANOS_PER_SEC
Definition: FieldTypes.h:89
FIX::DateTime::SECONDS_PER_MIN
static const int64_t SECONDS_PER_MIN
Definition: FieldTypes.h:83
FIX::DateTime::nowLocal
static DateTime nowLocal()
Return the current wall-clock time as a local DateTime.
Definition: FieldTypes.cpp:64
FIX::DateTime::setHMS
void setHMS(int hour, int minute, int second, int millis)
Set the time portion of the DateTime.
Definition: FieldTypes.h:303
FIX::DateTime::NANOS_PER_DAY
static const int64_t NANOS_PER_DAY
Definition: FieldTypes.h:86
FIX::DateTime::set
void set(int date, int64_t time)
Set the internal date and time members.
Definition: FieldTypes.h:385
FIX::operator<
bool operator<(const DatabaseConnectionID &lhs, const DatabaseConnectionID &rhs)
Definition: DatabaseConnectionID.h:81
FIX::DateTime::NANOS_PER_HOUR
static const int64_t NANOS_PER_HOUR
Definition: FieldTypes.h:87
FIX::DateTime::m_time
int64_t m_time
Definition: FieldTypes.h:78
FIX::DateTime::julianDate
static int julianDate(int year, int month, int day)
Helper method to calculate a Julian day number.
Definition: FieldTypes.h:527
FIX::DateTime::SECONDS_PER_HOUR
static const int64_t SECONDS_PER_HOUR
Definition: FieldTypes.h:82
FIX::DateTime::JULIAN_19700101
static const int64_t JULIAN_19700101
Definition: FieldTypes.h:92
int64_t
signed __int64 int64_t
Definition: stdint_msvc.h:90
FIX::time_gmtime
tm time_gmtime(const time_t *t)
Definition: Utility.cpp:399
FIX::DateTime::getHMS
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 si...
Definition: FieldTypes.h:233
FIX::DateTime::MINUTES_PER_HOUR
static const int64_t MINUTES_PER_HOUR
Definition: FieldTypes.h:84
FIX::PRECISION_FACTOR
static const int PRECISION_FACTOR[10]
Date and Time stored as a Julian day number and number of nanoseconds since midnight.
Definition: FieldTypes.h:73
FIX::DateTime::nowUtc
static DateTime nowUtc()
Return the current wall-clock time as a utc DateTime.
Definition: FieldTypes.cpp:49
FIX::DateTime::convertToNanos
static int convertToNanos(int fraction, int precision)
Convert to internal nanos.
Definition: FieldTypes.h:416
FIX::DateTime::DateTime
DateTime()
Default constructor - initializes to zero.
Definition: FieldTypes.h:95
FIX::DateTime::m_date
int m_date
Definition: FieldTypes.h:77
FIX::DateTime::fromLocalTimeT
static DateTime fromLocalTimeT(time_t t, int millis=0)
Definition: FieldTypes.h:489
FIX::DateTime::getNanosecond
unsigned int getNanosecond() const
Return the nanosecond portion of the time.
Definition: FieldTypes.h:181
FIX::DateTime::fromTm
static DateTime fromTm(const tm &tm, int millis=0)
Convert a tm and optional milliseconds to a DateTime.
Definition: FieldTypes.h:509
FIX::DateTime::SECONDS_PER_DAY
static const int64_t SECONDS_PER_DAY
Magic numbers.
Definition: FieldTypes.h:81
FIX::operator!=
bool operator!=(const DatabaseConnectionID &lhs, const DatabaseConnectionID &rhs)
Definition: DatabaseConnectionID.h:114
FIX::DateTime::getYMD
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.
Definition: FieldTypes.h:226
FIX::DateTime::getJulianDate
int getJulianDate() const
Return the internal julian date.
Definition: FieldTypes.h:148
FIX::DateTime::makeHMS
static int64_t makeHMS(int hour, int minute, int second, int nanos)
Helper method to convert a broken down time to a number of nanoseconds since midnight.
Definition: FieldTypes.h:469
FIX::DateTime::getTmUtc
tm getTmUtc() const
Convert the DateTime to a struct tm which is in UTC.
Definition: FieldTypes.h:276
FIX::DateTime::getYear
int getYear() const
Return the year portion of the date.
Definition: FieldTypes.h:120

Generated on Wed Apr 29 2020 19:41:30 for QuickFIX by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2001