Variant: Migraded from ISO8601d to Datetime
This commit is contained in:
@@ -31,7 +31,6 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <Variant.h>
|
#include <Variant.h>
|
||||||
#include <ISO8601.h>
|
|
||||||
#include <Datetime.h>
|
#include <Datetime.h>
|
||||||
#include <Duration.h>
|
#include <Duration.h>
|
||||||
#include <Lexer.h>
|
#include <Lexer.h>
|
||||||
@@ -1872,7 +1871,7 @@ void Variant::cast (const enum type new_type)
|
|||||||
case type_date:
|
case type_date:
|
||||||
{
|
{
|
||||||
_date = 0;
|
_date = 0;
|
||||||
ISO8601d iso;
|
Datetime iso;
|
||||||
std::string::size_type pos = 0;
|
std::string::size_type pos = 0;
|
||||||
if (iso.parse (_string, pos, dateFormat) &&
|
if (iso.parse (_string, pos, dateFormat) &&
|
||||||
pos == _string.length ())
|
pos == _string.length ())
|
||||||
@@ -1892,7 +1891,7 @@ void Variant::cast (const enum type new_type)
|
|||||||
|
|
||||||
if (dateFormat != "")
|
if (dateFormat != "")
|
||||||
{
|
{
|
||||||
_date = ISO8601d (_string, dateFormat).toEpoch ();
|
_date = Datetime (_string, dateFormat).toEpoch ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user