Roger Meier b0581433a7 LICENSE: add info about SPDX-License-Identifier usage and use it
fix: remove executable flag and change back to 100644 (was 100755)

Signed-off-by: Roger Meier <r.meier@siemens.com>
2014-05-14 08:38:09 +02:00

42 lines
898 B
C++

//
// DateTime.cpp
//
// $Id: //poco/1.4/Foundation/samples/DateTime/src/DateTime.cpp#1 $
//
// 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 argc, char** argv)
{
LocalDateTime now;
std::string str = DateTimeFormatter::format(now, DateTimeFormat::ISO8601_FORMAT);
DateTime dt;
int tzd;
DateTimeParser::parse(DateTimeFormat::ISO8601_FORMAT, str, dt, tzd);
dt.makeUTC(tzd);
LocalDateTime ldt(tzd, dt);
return 0;
}