-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.cpp
41 lines (33 loc) · 876 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// DateTime.cpp
//
// This sample demonstrates the DateTime class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/LocalDateTime.h"
#include "Poco/DateTime.h"
#include "Poco/DateTimeFormat.h"
#include "Poco/DateTimeFormatter.h"
#include "Poco/DateTimeParser.h"
#include <iostream>
using Poco::LocalDateTime;
using Poco::DateTime;
using Poco::DateTimeFormat;
using Poco::DateTimeFormatter;
using Poco::DateTimeParser;
int main(int, char**)
{
LocalDateTime now;
std::string str = DateTimeFormatter::format(now, DateTimeFormat::ISO8601_FORMAT);
std::cout << str << std::endl;
DateTime dt;
int tzd;
DateTimeParser::parse(DateTimeFormat::ISO8601_FORMAT, str, dt, tzd);
dt.makeUTC(tzd);
LocalDateTime ldt(tzd, dt);
return 0;
}