Enhancement - Date::toISO
- Added ISO date format support (19980119T070000Z) to Date class, for use in export.ical. - Added unit test.
This commit is contained in:
@@ -34,7 +34,7 @@ Context context;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (143);
|
||||
UnitTest t (144);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -150,6 +150,9 @@ int main (int argc, char** argv)
|
||||
Date fromEpoch (epoch.toEpoch ());
|
||||
t.is (fromEpoch.toString (), epoch.toString (), "ctor (time_t)");
|
||||
|
||||
Date iso (1000000000);
|
||||
t.is (iso.toISO (), "20010909T014640Z", "1,000,000,000 -> 20010909T014640Z");
|
||||
|
||||
// Date parsing.
|
||||
Date fromString1 ("1/1/2008");
|
||||
t.is (fromString1.month (), 1, "ctor (std::string) -> m");
|
||||
|
||||
Reference in New Issue
Block a user