FieldTypes.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 
3 /****************************************************************************
4 ** Copyright (c) 2001-2014
5 **
6 ** This file is part of the QuickFIX FIX Engine
7 **
8 ** This file may be distributed under the terms of the quickfixengine.org
9 ** license as defined by quickfixengine.org and appearing in the file
10 ** LICENSE included in the packaging of this file.
11 **
12 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14 **
15 ** See http://www.quickfixengine.org/LICENSE for licensing information.
16 **
17 ** Contact ask@quickfixengine.org if any conditions of this licensing are
18 ** not clear to you.
19 **
20 ****************************************************************************/
21 
22 #ifndef FIX_FIELDTYPES_H
23 #define FIX_FIELDTYPES_H
24 
25 #ifdef _MSC_VER
26 #pragma warning( disable : 4503 4355 4786 4290 )
27 #endif
28 
29 #include "Utility.h"
30 #include <string>
31 #include <time.h>
32 
33 namespace FIX
34 {
39 struct DateTime
51 {
52  int m_date;
53  int m_time;
54 
56  enum
57  {
58  SECONDS_PER_DAY = 86400,
62 
63  MILLIS_PER_DAY = 86400000,
64  MILLIS_PER_HOUR = 3600000,
65  MILLIS_PER_MIN = 60000,
67 
68  // time_t epoch (1970-01-01) as a Julian date
69  JULIAN_19700101 = 2440588
70  };
71 
73  DateTime () : m_date (0), m_time (0) {}
74 
76  DateTime (int date, int time) : m_date (date), m_time (time) {}
77 
79  DateTime( int year, int month, int day,
80  int hour, int minute, int second, int millis )
81  {
82  m_date = julianDate( year, month, day );
83  m_time = makeHMS( hour, minute, second, millis );
84  }
85 
86  virtual ~DateTime() {}
87 
89  inline int getYear() const
90  {
91  int y, m, d;
92  getYMD( y, m, d );
93  return y;
94  }
95 
97  inline int getMonth() const
98  {
99  int y, m, d;
100  getYMD( y, m, d );
101  return m;
102  }
103 
105  inline int getDay() const
106  {
107  int y, m, d;
108  getYMD( y, m, d );
109  return d;
110  }
111 
114  inline int getDate() const { return getDay(); }
115 
117  inline int getJulianDate() const { return m_date; }
118 
120  inline int getHour() const
121  {
122  return m_time / MILLIS_PER_HOUR;
123  }
124 
126  inline int getMinute() const
127  {
129  }
130 
132  inline int getSecond() const
133  {
135  }
136 
138  inline int getMillisecond() const
139  {
140  return m_time % MILLIS_PER_SEC;
141  }
142 
145  inline void getYMD (int& year, int& month, int& day) const
146  {
147  getYMD( m_date, year, month, day );
148  }
149 
152  inline void getHMS( int& hour, int& minute, int& second, int& millis ) const
153  {
154  int ticks = m_time / MILLIS_PER_SEC;
155  hour = ticks / SECONDS_PER_HOUR;
156  minute = (ticks / SECONDS_PER_MIN) % MINUTES_PER_HOUR;
157  second = ticks % SECONDS_PER_MIN;
158  millis = m_time % MILLIS_PER_SEC;
159  }
160 
162  inline int getWeekDay() const
163  {
164  int Y, M, D;
165  getYMD (Y, M, D);
166  int m = M >= 3 ? M - 2 : M + 10;
167  int Yprime = M >= 3 ? Y : Y - 1;
168  int y = Yprime % 100;
169  int c = Yprime / 100;
170  int wd = (D + int (2.6 * m - 0.2) + y + int (y / 4) + int (c / 4) -
171  (2 * c)) % 7;
172  return 1 + (wd < 0 ? 7 + wd : wd);
173  }
174 
177  inline time_t getTimeT() const
178  {
179  return (SECONDS_PER_DAY * (m_date - JULIAN_19700101) +
181  }
182 
184  tm getTmUtc() const
185  {
186  int year, month, day;
187  int hour, minute, second, millis;
188  tm result = { 0 };
189 
190  getYMD( year, month, day );
191  getHMS( hour, minute, second, millis );
192 
193  result.tm_year = year - 1900;
194  result.tm_mon = month - 1;
195  result.tm_mday = day;
196  result.tm_hour = hour;
197  result.tm_min = minute;
198  result.tm_sec = second;
199  result.tm_isdst = -1;
200 
201  return result;
202  }
203 
205  void setYMD( int year, int month, int day )
206  {
207  m_date = julianDate( year, month, day );
208  }
209 
211  void setHMS( int hour, int minute, int second, int millis )
212  {
213  m_time = makeHMS( hour, minute, second, millis );
214  }
215 
217  void setHour( int hour )
218  {
219  int old_hour, min, sec, millis;
220  getHMS( old_hour, min, sec, millis );
221  setHMS( hour, min, sec, millis );
222  }
223 
225  void setMinute( int min )
226  {
227  int hour, old_min, sec, millis;
228  getHMS( hour, old_min, sec, millis );
229  setHMS( hour, min, sec, millis );
230  }
231 
233  void setSecond( int sec )
234  {
235  int hour, min, old_sec, millis;
236  getHMS( hour, min, old_sec, millis );
237  setHMS( hour, min, sec, millis );
238  }
239 
241  void setMillisecond( int millis )
242  {
243  int hour, min, sec, old_millis;
244  getHMS( hour, min, sec, old_millis );
245  setHMS( hour, min, sec, millis );
246  }
247 
249  void clearDate()
250  {
251  m_date = 0;
252  }
253 
255  void clearTime()
256  {
257  m_time = 0;
258  }
259 
261  void set( int date, int time ) { m_date = date; m_time = time; }
262 
264  void set( const DateTime& other )
265  {
266  m_date = other.m_date;
267  m_time = other.m_time;
268  }
269 
271  void operator+=( int seconds )
272  {
273  int d = seconds / SECONDS_PER_DAY;
274  int s = seconds % SECONDS_PER_DAY;
275 
276  m_date += d;
277  m_time += s * MILLIS_PER_SEC;
278 
279  if( m_time > MILLIS_PER_DAY )
280  {
281  m_date++;
283  }
284  else if( m_time < 0 )
285  {
286  m_date--;
288  }
289  }
290 
293  static int makeHMS( int hour, int minute, int second, int millis )
294  {
295  return MILLIS_PER_SEC * (SECONDS_PER_HOUR * hour +
296  SECONDS_PER_MIN * minute +
297  second) + millis;
298  }
299 
301  static DateTime nowUtc();
302 
304  static DateTime nowLocal();
305 
307  static DateTime fromUtcTimeT( time_t t, int millis = 0 )
308  {
309  struct tm tm = time_gmtime( &t );
310  return fromTm( tm, millis );
311  }
312 
313  static DateTime fromLocalTimeT( time_t t, int millis = 0 )
314  {
315  struct tm tm = time_localtime( &t );
316  return fromTm( tm, millis );
317  }
318 
321  static DateTime fromTm( const tm& tm, int millis = 0 )
322  {
323  return DateTime ( julianDate(tm.tm_year + 1900, tm.tm_mon + 1,
324  tm.tm_mday),
325  makeHMS(tm.tm_hour, tm.tm_min, tm.tm_sec, millis) );
326  }
327 
329  static int julianDate( int year, int month, int day )
330  {
331  int a = (14 - month) / 12;
332  int y = year + 4800 - a;
333  int m = month + 12 * a - 3;
334  return (day + int ((153 * m + 2) / 5) + y * 365 +
335  int (y / 4) - int (y / 100) + int (y / 400) - 32045);
336  }
337 
339  static void getYMD( int jday, int& year, int& month, int& day )
340  {
341  int a = jday + 32044;
342  int b = (4 * a + 3) / 146097;
343  int c = a - int ((b * 146097) / 4);
344  int d = (4 * c + 3) / 1461;
345  int e = c - int ((1461 * d) / 4);
346  int m = (5 * e + 2) / 153;
347  day = e - int ((153 * m + 2) / 5) + 1;
348  month = m + 3 - 12 * int (m / 10);
349  year = b * 100 + d - 4800 + int (m / 10);
350  }
351 };
352 
353 inline bool operator==( const DateTime& lhs, const DateTime& rhs )
354 {
355  return lhs.m_date == rhs.m_date && lhs.m_time == rhs.m_time;
356 }
357 
358 inline bool operator!=( const DateTime& lhs, const DateTime& rhs )
359 {
360  return !(lhs == rhs);
361 }
362 
363 inline bool operator<( const DateTime& lhs, const DateTime& rhs )
364 {
365  if( lhs.m_date < rhs.m_date )
366  return true;
367  else if( lhs.m_date > rhs.m_date )
368  return false;
369  else if( lhs.m_time < rhs.m_time )
370  return true;
371  return false;
372 }
373 
374 inline bool operator>( const DateTime& lhs, const DateTime& rhs )
375 {
376  return !(lhs == rhs || lhs < rhs);
377 }
378 
379 inline bool operator<=( const DateTime& lhs, const DateTime& rhs )
380 {
381  return lhs == rhs || lhs < rhs;
382 }
383 
384 inline bool operator>=( const DateTime& lhs, const DateTime& rhs )
385 {
386  return lhs == rhs || lhs > rhs;
387 }
388 
391 inline int operator-( const DateTime& lhs, const DateTime& rhs )
392 {
393  return (DateTime::SECONDS_PER_DAY * (lhs.m_date - rhs.m_date) +
394  // Truncate the millis before subtracting
395  lhs.m_time / 1000 - rhs.m_time / 1000);
396 }
397 
399 class UtcTimeStamp : public DateTime
400 {
401 public:
404  : DateTime( DateTime::nowUtc() ) {}
405 
407  UtcTimeStamp( int hour, int minute, int second, int millisecond = 0 )
408  : DateTime( DateTime::nowUtc() )
409  {
410  setHMS( hour, minute, second, millisecond );
411  }
412 
413  UtcTimeStamp( int hour, int minute, int second,
414  int date, int month, int year )
415  : DateTime( year, month, date, hour, minute, second, 0 ) {}
416 
417  UtcTimeStamp( int hour, int minute, int second, int millisecond,
418  int date, int month, int year )
419  : DateTime( year, month, date, hour, minute, second, millisecond ) {}
420 
421  explicit UtcTimeStamp( time_t time, int millisecond = 0 )
422  : DateTime( fromUtcTimeT (time, millisecond) ) {}
423 
424  UtcTimeStamp( const tm* time, int millisecond = 0 )
425  : DateTime( fromTm (*time, millisecond) ) {}
426 
427  void setCurrent()
428  {
429  set( DateTime::nowUtc() );
430  }
431 };
432 
434 class LocalTimeStamp : public DateTime
435 {
436 public:
439  : DateTime( DateTime::nowLocal() ) {}
440 
442  LocalTimeStamp( int hour, int minute, int second, int millisecond = 0 )
443  : DateTime( DateTime::nowLocal() )
444  {
445  setHMS( hour, minute, second, millisecond );
446  }
447 
448  LocalTimeStamp( int hour, int minute, int second,
449  int date, int month, int year )
450  : DateTime( year, month, date, hour, minute, second, 0 ) {}
451 
452  LocalTimeStamp( int hour, int minute, int second, int millisecond,
453  int date, int month, int year )
454  : DateTime( year, month, date, hour, minute, second, millisecond ) {}
455 
456  explicit LocalTimeStamp( time_t time, int millisecond = 0 )
457  : DateTime( fromLocalTimeT (time, millisecond) ) {}
458 
459  LocalTimeStamp( const tm* time, int millisecond = 0 )
460  : DateTime( fromTm (*time, millisecond) ) {}
461 
462  void setCurrent()
463  {
464  set( DateTime::nowLocal() );
465  }
466 };
467 
469 class UtcTimeOnly : public DateTime
470 {
471 public:
474  {
475  setCurrent();
476  }
477 
478  UtcTimeOnly( const DateTime& val )
479  : DateTime(val)
480  {
481  clearDate();
482  }
483 
484  UtcTimeOnly( int hour, int minute, int second, int millisecond = 0 )
485  {
486  setHMS( hour, minute, second, millisecond );
487  }
488 
489  explicit UtcTimeOnly( time_t time, int millisecond = 0 )
490  : DateTime( fromUtcTimeT (time, millisecond) )
491  {
492  clearDate();
493  }
494 
495  UtcTimeOnly( const tm* time, int millisecond = 0 )
496  : DateTime( fromTm (*time, millisecond) )
497  {
498  clearDate();
499  }
500 
502  void setCurrent()
503  {
504  DateTime d = nowUtc();
505  m_time = d.m_time;
506  }
507 };
508 
510 class LocalTimeOnly : public DateTime
511 {
512 public:
515  {
516  setCurrent();
517  }
518 
519  LocalTimeOnly( const DateTime& val )
520  : DateTime(val)
521  {
522  clearDate();
523  }
524 
525  LocalTimeOnly( int hour, int minute, int second, int millisecond = 0 )
526  {
527  setHMS( hour, minute, second, millisecond );
528  }
529 
530  explicit LocalTimeOnly( time_t time, int millisecond = 0 )
531  : DateTime( fromLocalTimeT (time, millisecond) )
532  {
533  clearDate();
534  }
535 
536  LocalTimeOnly( const tm* time, int millisecond = 0 )
537  : DateTime( fromTm (*time, millisecond) )
538  {
539  clearDate();
540  }
541 
543  void setCurrent()
544  {
545  DateTime d = nowLocal();
546  m_time = d.m_time;
547  }
548 };
549 
551 class UtcDate : public DateTime
552 {
553 public:
556  {
557  setCurrent();
558  }
559 
560  UtcDate( const DateTime& val )
561  : DateTime( val )
562  {
563  clearTime();
564  }
565 
566  UtcDate( int date, int month, int year )
567  : DateTime(year, month, date, 0, 0, 0, 0) {}
568 
569  UtcDate( long sec )
570  : DateTime( sec / DateTime::SECONDS_PER_DAY, 0 ) {}
571 
572  UtcDate( const tm* time )
573  : DateTime( fromTm (*time) )
574  {
575  clearTime();
576  }
577 
579  void setCurrent()
580  {
581  DateTime d = nowUtc();
582  m_date = d.m_date;
583  }
584 };
585 
587 class LocalDate : public DateTime
588 {
589 public:
592  {
593  setCurrent();
594  }
595 
596  LocalDate( const DateTime& val )
597  : DateTime( val )
598  {
599  clearTime();
600  }
601 
602  LocalDate( int date, int month, int year )
603  : DateTime(year, month, date, 0, 0, 0, 0) {}
604 
605  LocalDate( long sec )
606  : DateTime( sec / DateTime::SECONDS_PER_DAY, 0 ) {}
607 
608  LocalDate( const tm* time )
609  : DateTime( fromTm (*time) )
610  {
611  clearTime();
612  }
613 
615  void setCurrent()
616  {
617  DateTime d = nowLocal();
618  m_date = d.m_date;
619  }
620 };
621 
625 
626 typedef std::string STRING;
627 typedef char CHAR;
628 typedef double PRICE;
629 typedef int INT;
630 typedef double AMT;
631 typedef double QTY;
632 typedef std::string CURRENCY;
633 typedef std::string MULTIPLEVALUESTRING;
634 typedef std::string MULTIPLESTRINGVALUE;
635 typedef std::string MULTIPLECHARVALUE;
636 typedef std::string EXCHANGE;
638 typedef bool BOOLEAN;
639 typedef std::string LOCALMKTDATE;
640 typedef std::string DATA;
641 typedef double FLOAT;
642 typedef double PRICEOFFSET;
643 typedef std::string MONTHYEAR;
644 typedef std::string DAYOFMONTH;
645 typedef UtcDate UTCDATE;
648 typedef int NUMINGROUP;
649 typedef double PERCENTAGE;
650 typedef int SEQNUM;
651 typedef int LENGTH;
652 typedef std::string COUNTRY;
653 typedef std::string TZTIMEONLY;
654 typedef std::string TZTIMESTAMP;
655 typedef std::string XMLDATA;
656 typedef std::string LANGUAGE;
657 
658 namespace TYPE
659 {
660 enum Type
661 {
694 };
695 }
696 }
697 
698 #endif //FIX_FIELDTYPES_H
void setHour(int hour)
Set the hour portion of the time.
Definition: FieldTypes.h:217
double PRICEOFFSET
Definition: FieldTypes.h:642
int operator-(const DateTime &lhs, const DateTime &rhs)
Calculate the difference between two DateTime values and return the result as a number of seconds...
Definition: FieldTypes.h:391
UtcTimeOnly(time_t time, int millisecond=0)
Definition: FieldTypes.h:489
UtcDate(const DateTime &val)
Definition: FieldTypes.h:560
void setMillisecond(int millis)
Set the millisecond portion of the time.
Definition: FieldTypes.h:241
LocalTimeStamp(int hour, int minute, int second, int millisecond, int date, int month, int year)
Definition: FieldTypes.h:452
DateTime(int date, int time)
Construct from a Julian day number and time in millis.
Definition: FieldTypes.h:76
void set(const DateTime &other)
Initialize from another DateTime.
Definition: FieldTypes.h:264
int getHour() const
Return the hour portion of the time (0-23)
Definition: FieldTypes.h:120
double FLOAT
Definition: FieldTypes.h:641
LocalTimeOnly(const DateTime &val)
Definition: FieldTypes.h:519
std::string LANGUAGE
Definition: FieldTypes.h:656
std::string MULTIPLESTRINGVALUE
Definition: FieldTypes.h:634
Time only represented in UTC.
Definition: FieldTypes.h:469
int getMinute() const
Return the minute portion of the time (0-59)
Definition: FieldTypes.h:126
time_t getTimeT() const
Convert the DateTime to a time_t.
Definition: FieldTypes.h:177
tm time_localtime(const time_t *t)
Definition: Utility.cpp:377
bool operator!=(const DatabaseConnectionID &lhs, const DatabaseConnectionID &rhs)
LocalTimeOnly(time_t time, int millisecond=0)
Definition: FieldTypes.h:530
Date and Time represented in local time.
Definition: FieldTypes.h:434
static DateTime fromUtcTimeT(time_t t, int millis=0)
Convert a time_t and optional milliseconds to a DateTime.
Definition: FieldTypes.h:307
bool operator>=(const StringField &lhs, const char *rhs)
Definition: Field.h:218
std::string MULTIPLEVALUESTRING
Definition: FieldTypes.h:633
LocalDate(long sec)
Definition: FieldTypes.h:605
LocalTimeOnly()
Defaults to the current time.
Definition: FieldTypes.h:514
std::string MONTHYEAR
Definition: FieldTypes.h:643
UtcDate UTCDATE
Definition: FieldTypes.h:645
UtcTimeOnly(const tm *time, int millisecond=0)
Definition: FieldTypes.h:495
std::string XMLDATA
Definition: FieldTypes.h:655
double QTY
Definition: FieldTypes.h:631
int NUMINGROUP
Definition: FieldTypes.h:648
char CHAR
Definition: FieldTypes.h:627
UtcTimeStamp(int hour, int minute, int second, int millisecond=0)
Defaults to the current date.
Definition: FieldTypes.h:407
LocalTimeOnly(const tm *time, int millisecond=0)
Definition: FieldTypes.h:536
double PERCENTAGE
Definition: FieldTypes.h:649
LocalDate()
Defaults to the current date.
Definition: FieldTypes.h:591
std::string EXCHANGE
Definition: FieldTypes.h:636
bool operator==(const DatabaseConnectionID &lhs, const DatabaseConnectionID &rhs)
LocalDate(const DateTime &val)
Definition: FieldTypes.h:596
bool BOOLEAN
Definition: FieldTypes.h:638
int getWeekDay() const
Calculate the weekday of the date (Sunday is 1, Saturday is 7)
Definition: FieldTypes.h:162
void clearTime()
Clear the time portion of the DateTime.
Definition: FieldTypes.h:255
static int julianDate(int year, int month, int day)
Helper method to calculate a Julian day number.
Definition: FieldTypes.h:329
std::string MULTIPLECHARVALUE
Definition: FieldTypes.h:635
tm time_gmtime(const time_t *t)
Definition: Utility.cpp:361
Time only represented in local time.
Definition: FieldTypes.h:510
int getMillisecond() const
Return the millisecond portion of the time.
Definition: FieldTypes.h:138
UtcTimeOnly(int hour, int minute, int second, int millisecond=0)
Definition: FieldTypes.h:484
int getYear() const
Return the year portion of the date.
Definition: FieldTypes.h:89
void clearDate()
Clear the date portion of the DateTime.
Definition: FieldTypes.h:249
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.
Definition: FieldTypes.h:293
DateTime(int year, int month, int day, int hour, int minute, int second, int millis)
Construct from the specified components.
Definition: FieldTypes.h:79
UtcDate()
Defaults to the current date.
Definition: FieldTypes.h:555
UtcTimeOnly()
Defaults to the current time.
Definition: FieldTypes.h:473
UtcTimeStamp(const tm *time, int millisecond=0)
Definition: FieldTypes.h:424
int getDate() const
Another name for the day of the month.
Definition: FieldTypes.h:114
LocalTimeStamp(const tm *time, int millisecond=0)
Definition: FieldTypes.h:459
Date only represented in UTC.
Definition: FieldTypes.h:551
UtcDate UtcDateOnly
Definition: FieldTypes.h:624
UtcTimeStamp UTCTIMESTAMP
Definition: FieldTypes.h:637
tm getTmUtc() const
Convert the DateTime to a struct tm which is in UTC.
Definition: FieldTypes.h:184
std::string DAYOFMONTH
Definition: FieldTypes.h:644
std::string TZTIMESTAMP
Definition: FieldTypes.h:654
static DateTime fromLocalTimeT(time_t t, int millis=0)
Definition: FieldTypes.h:313
std::string LOCALMKTDATE
Definition: FieldTypes.h:639
LocalTimeStamp(int hour, int minute, int second, int date, int month, int year)
Definition: FieldTypes.h:448
LocalDate(const tm *time)
Definition: FieldTypes.h:608
UtcDate(long sec)
Definition: FieldTypes.h:569
LocalDate(int date, int month, int year)
Definition: FieldTypes.h:602
UtcTimeOnly UTCTIMEONLY
Definition: FieldTypes.h:647
UtcTimeStamp()
Defaults to the current date and time.
Definition: FieldTypes.h:403
void setCurrent()
Set to the current time.
Definition: FieldTypes.h:543
void setCurrent()
Set to the current time.
Definition: FieldTypes.h:502
UtcDate(int date, int month, int year)
Definition: FieldTypes.h:566
DateTime()
Default constructor - initializes to zero.
Definition: FieldTypes.h:73
LocalTimeStamp(time_t time, int millisecond=0)
Definition: FieldTypes.h:456
std::string DATA
Definition: FieldTypes.h:640
bool operator>(const StringField &lhs, const char *rhs)
Definition: Field.h:202
void setCurrent()
Set to the current time.
Definition: FieldTypes.h:579
LocalTimeStamp(int hour, int minute, int second, int millisecond=0)
Defaults to the current date.
Definition: FieldTypes.h:442
void operator+=(int seconds)
Add a number of seconds to this.
Definition: FieldTypes.h:271
void setMinute(int min)
Set the minute portion of the time.
Definition: FieldTypes.h:225
static DateTime nowUtc()
Return the current wall-clock time as a utc DateTime.
Definition: FieldTypes.cpp:34
UtcTimeStamp(time_t time, int millisecond=0)
Definition: FieldTypes.h:421
void setCurrent()
Set to the current time.
Definition: FieldTypes.h:615
std::string CURRENCY
Definition: FieldTypes.h:632
bool operator<=(const StringField &lhs, const char *rhs)
Definition: Field.h:214
int getDay() const
Return the day of the month portion of the date.
Definition: FieldTypes.h:105
double AMT
Definition: FieldTypes.h:630
void setYMD(int year, int month, int day)
Set the date portion of the DateTime.
Definition: FieldTypes.h:205
Date and Time represented in UTC.
Definition: FieldTypes.h:399
std::string TZTIMEONLY
Definition: FieldTypes.h:653
LocalTimeStamp()
Defaults to the current date and time.
Definition: FieldTypes.h:438
void setSecond(int sec)
Set the seconds portion of the time.
Definition: FieldTypes.h:233
static DateTime nowLocal()
Return the current wall-clock time as a local DateTime.
Definition: FieldTypes.cpp:49
double PRICE
Definition: FieldTypes.h:628
int getJulianDate() const
Return the internal julian date.
Definition: FieldTypes.h:117
static DateTime fromTm(const tm &tm, int millis=0)
Convert a tm and optional milliseconds to a DateTime.
Definition: FieldTypes.h:321
int SEQNUM
Definition: FieldTypes.h:650
void set(int date, int time)
Set the internal date and time members.
Definition: FieldTypes.h:261
int getMonth() const
Return the month (1-12) portion of the date.
Definition: FieldTypes.h:97
static void getYMD(int jday, int &year, int &month, int &day)
Convert a Julian day number to a year, month and day.
Definition: FieldTypes.h:339
LocalTimeOnly(int hour, int minute, int second, int millisecond=0)
Definition: FieldTypes.h:525
virtual ~DateTime()
Definition: FieldTypes.h:86
Date and Time stored as a Julian day number and number of milliseconds since midnight.
Definition: FieldTypes.h:50
UtcTimeStamp(int hour, int minute, int second, int date, int month, int year)
Definition: FieldTypes.h:413
int INT
Definition: FieldTypes.h:629
UtcTimeStamp(int hour, int minute, int second, int millisecond, int date, int month, int year)
Definition: FieldTypes.h:417
UtcDateOnly UTCDATEONLY
Definition: FieldTypes.h:646
int getSecond() const
Return the second portion of the time (0-59)
Definition: FieldTypes.h:132
Date only represented in local time.
Definition: FieldTypes.h:587
std::string COUNTRY
Definition: FieldTypes.h:652
int LENGTH
Definition: FieldTypes.h:651
UtcTimeOnly(const DateTime &val)
Definition: FieldTypes.h:478
std::string STRING
Definition: FieldTypes.h:626
bool operator<(const DatabaseConnectionID &lhs, const DatabaseConnectionID &rhs)
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:145
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:152
UtcDate(const tm *time)
Definition: FieldTypes.h:572
void setHMS(int hour, int minute, int second, int millis)
Set the time portion of the DateTime.
Definition: FieldTypes.h:211

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