Encapsulates UTCTimestamp FIX type.
More...
#include <B2BITS_UTCTimestamp.h>
|
typedef System::u64 | value_type |
| A type that represents internal representation of the date.
|
|
|
int | day () const throw () |
| Returns day part of value.
|
|
int | dayOfWeek () const throw () |
| Returns day of the week.
|
|
UTCTimestamp | getWithoutMilliseconds () const throw () |
| Erases milliseconds.
|
|
int | hour () const throw () |
| Returns day hour of value.
|
|
int | millisecond () const throw () |
| Returns day millisecond of value.
|
|
int | minute () const throw () |
| Returns day minute of value.
|
|
int | month () const throw () |
| Returns month part of value.
|
|
bool | operator!= (const UTCTimestamp &v) const throw () |
| Compare operators.
|
|
bool | operator< (const UTCTimestamp &v) const throw () |
| Compare operators.
|
|
bool | operator<= (const UTCTimestamp &v) const throw () |
| Compare operators.
|
|
bool | operator== (const UTCTimestamp &v) const throw () |
| Compare operators.
|
|
bool | operator> (const UTCTimestamp &v) const throw () |
| Compare operators.
|
|
bool | operator>= (const UTCTimestamp &v) const throw () |
| Compare operators.
|
|
int | second () const throw () |
| Returns day second of value.
|
|
System::u64 | toDecimal () const throw () |
| Returns value in decimal format (YYYYMMDDHHMMSSzzz)
|
|
char * | toFixString (char *buf, char *end, bool keepmsec=false) const throw () |
| Converts stored value to FIX string 'YYYYMMDD-HH:MM:SS.zzz'.
|
|
std::string & | toFixString (std::string *dest, bool keepmsec=false) const |
| Converts value stored in object to FIX string 'YYYYMMDD-HH:MM:SS.zzz'.
|
|
| UTCTimestamp () throw () |
| Default constructor.
|
|
| UTCTimestamp (int year, int month, int day, int hour, int minute, int second, int millisecond=0) throw () |
| Constructor. Constructs object from year, month, day, hour, minute, second and millisecond values.
|
|
int | year () const throw () |
| Returns year part of value.
|
|
Encapsulates UTCTimestamp FIX type.
◆ value_type
A type that represents internal representation of the date.
◆ UTCTimestamp() [1/2]
Engine::UTCTimestamp::UTCTimestamp |
( |
| ) |
|
throw | ( | ) | | | |
◆ UTCTimestamp() [2/2]
Engine::UTCTimestamp::UTCTimestamp |
( |
int | year, |
|
|
int | month, |
|
|
int | day, |
|
|
int | hour, |
|
|
int | minute, |
|
|
int | second, |
|
|
int | millisecond = 0 ) |
throw | ( | ) | | | |
Constructor. Constructs object from year, month, day, hour, minute, second and millisecond values.
◆ day()
int Engine::UTCTimestamp::day |
( |
| ) |
const |
throw | ( | ) | | | |
Returns day part of value.
◆ dayOfWeek()
int Engine::UTCTimestamp::dayOfWeek |
( |
| ) |
const |
throw | ( | ) | | | |
Returns day of the week.
0 means Sunday, 1 - Monday, 2 - Tuesday, ... 5 - Friday
◆ fromDecimal()
static UTCTimestamp Engine::UTCTimestamp::fromDecimal |
( |
System::u64 | val | ) |
|
throw | ( | ) | | | |
|
static |
Constructs object from decimal date format (YYYYMMDDHHMMSSzzz).
◆ fromDecimalString()
Constructs object from decimal date format (YYYYMMDDHHMMSSzzz).
◆ fromFixString()
Constructs object from FIX string (YYYYMMDD-HH:MM:SS.zzz).
◆ fromString()
Constructs object from decimal date format (YYYYMMDDHHMMSSzzz) or FIX string (YYYYMMDD-HH:MM:SS.zzz).
◆ fromTimeT()
static UTCTimestamp Engine::UTCTimestamp::fromTimeT |
( |
time_t | t, |
|
|
int | millis = 0 ) |
throw | ( | ) | | | |
|
static |
Constructs object using time_t value.
In case of error (if passed value is too large) function returns zero UTCTimestamp (00000000-00:00:00.000)
◆ fromUnixTimeInMillis()
static UTCTimestamp Engine::UTCTimestamp::fromUnixTimeInMillis |
( |
System::u64 | val | ) |
|
throw | ( | ) | | | |
|
static |
Constructs object using the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
In case of error (if passed value is too large) function returns zero UTCTimestamp (00000000-00:00:00.000)
◆ getWithoutMilliseconds()
UTCTimestamp Engine::UTCTimestamp::getWithoutMilliseconds |
( |
| ) |
const |
throw | ( | ) | | | |
|
inline |
◆ hour()
int Engine::UTCTimestamp::hour |
( |
| ) |
const |
throw | ( | ) | | | |
Returns day hour of value.
◆ millisecond()
int Engine::UTCTimestamp::millisecond |
( |
| ) |
const |
throw | ( | ) | | | |
Returns day millisecond of value.
◆ minute()
int Engine::UTCTimestamp::minute |
( |
| ) |
const |
throw | ( | ) | | | |
Returns day minute of value.
◆ month()
int Engine::UTCTimestamp::month |
( |
| ) |
const |
throw | ( | ) | | | |
Returns month part of value.
◆ now()
static UTCTimestamp Engine::UTCTimestamp::now |
( |
bool | withMilliseconds = false | ) |
|
throw | ( | ) | | | |
|
static |
Returns UTCTimestamp with current time.
- Parameters
-
withMIlliseconds | Pass to to obtain time with milliseconds; false otherwise. |
- Returns
- Instance of the UTCTimestamp which contains current time.
◆ operator!=()
bool Engine::UTCTimestamp::operator!= |
( |
const UTCTimestamp & | v | ) |
const |
throw | ( | ) | | | |
|
inline |
◆ operator<()
bool Engine::UTCTimestamp::operator< |
( |
const UTCTimestamp & | v | ) |
const |
throw | ( | ) | | | |
|
inline |
◆ operator<=()
bool Engine::UTCTimestamp::operator<= |
( |
const UTCTimestamp & | v | ) |
const |
throw | ( | ) | | | |
|
inline |
◆ operator==()
bool Engine::UTCTimestamp::operator== |
( |
const UTCTimestamp & | v | ) |
const |
throw | ( | ) | | | |
|
inline |
◆ operator>()
bool Engine::UTCTimestamp::operator> |
( |
const UTCTimestamp & | v | ) |
const |
throw | ( | ) | | | |
|
inline |
◆ operator>=()
bool Engine::UTCTimestamp::operator>= |
( |
const UTCTimestamp & | v | ) |
const |
throw | ( | ) | | | |
|
inline |
◆ second()
int Engine::UTCTimestamp::second |
( |
| ) |
const |
throw | ( | ) | | | |
Returns day second of value.
◆ toDecimal()
System::u64 Engine::UTCTimestamp::toDecimal |
( |
| ) |
const |
throw | ( | ) | | | |
Returns value in decimal format (YYYYMMDDHHMMSSzzz)
◆ toFixString() [1/2]
char * Engine::UTCTimestamp::toFixString |
( |
char * | buf, |
|
|
char * | end, |
|
|
bool | keepmsec = false ) const |
throw | ( | ) | | | |
Converts stored value to FIX string 'YYYYMMDD-HH:MM:SS.zzz'.
- Parameters
-
buf | Memory buffer enough to store string like YYYYMMDD-HH:MM:SS.zzz |
- Returns
- pointer to the first character of the result. Last character of result is last character of the 'buf' parameter.
◆ toFixString() [2/2]
std::string & Engine::UTCTimestamp::toFixString |
( |
std::string * | dest, |
|
|
bool | keepmsec = false ) const |
Converts value stored in object to FIX string 'YYYYMMDD-HH:MM:SS.zzz'.
◆ year()
int Engine::UTCTimestamp::year |
( |
| ) |
const |
throw | ( | ) | | | |
Returns year part of value.
◆ DecimalValueSizeNoMilliseconds
const unsigned int Engine::UTCTimestamp::DecimalValueSizeNoMilliseconds = sizeof( "YYYYMMDDHHMMSS" ) - 1 |
|
static |
Maximum buffer size required to store value.
◆ DecimalValueSizeWithMilliseconds
const unsigned int Engine::UTCTimestamp::DecimalValueSizeWithMilliseconds = sizeof( "YYYYMMDDHHMMSSsss" ) - 1 |
|
static |
Maximum buffer size required to store value.
◆ ValueSize
Maximum buffer size required to store value.
◆ ValueSizeNoMilliseconds
const unsigned int Engine::UTCTimestamp::ValueSizeNoMilliseconds = sizeof( "YYYYMMDD-HH:MM:SS" ) - 1 |
|
static |
◆ ValueSizeWithMilliseconds
const unsigned int Engine::UTCTimestamp::ValueSizeWithMilliseconds = sizeof( "YYYYMMDD-HH:MM:SS.sss" ) - 1 |
|
static |