mirror of
https://github.com/boostorg/date_time.git
synced 2026-02-22 03:12:24 +00:00
https://svn.boost.org/svn/boost/trunk ........ r43417 | danieljames | 2008-02-26 22:04:55 +0000 (Tue, 26 Feb 2008) | 2 lines Fix a link to Boost.Bimap. ........ r43418 | danieljames | 2008-02-26 22:07:25 +0000 (Tue, 26 Feb 2008) | 2 lines Change another link that's no longer in the repository to link to the website. ........ r43422 | danieljames | 2008-02-27 18:51:14 +0000 (Wed, 27 Feb 2008) | 1 line Fix broken copyright urls. Fixes #1573. ........ r43423 | danieljames | 2008-02-27 19:22:01 +0000 (Wed, 27 Feb 2008) | 1 line Fix incorrect links to copyright of the form 'http:#www.boost.org ........ [SVN r43425]
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
/* Copyright (c) 2003-2004 CrystalClear Software, Inc.
|
|
* Subject to the Boost Software License, Version 1.0.
|
|
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
|
* Author: Jeff Garland, Bart Garst
|
|
* $Date$
|
|
*/
|
|
|
|
#include "boost/date_time/local_time/local_time.hpp"
|
|
#include <iostream>
|
|
|
|
// The actual clocks are tested in posix_time/testclock.cpp.
|
|
// These tests are to verify that the time zone is applied correctly
|
|
|
|
int
|
|
main()
|
|
{
|
|
using namespace boost::gregorian;
|
|
using namespace boost::posix_time;
|
|
using namespace boost::local_time;
|
|
|
|
|
|
boost::shared_ptr<time_zone> az_tz(new posix_time_zone("MST-07"));
|
|
boost::shared_ptr<time_zone> ny_tz(new posix_time_zone("EST-05EDT,M4.1.0,M10.5.0"));
|
|
|
|
ptime tl = second_clock::local_time();
|
|
std::cout << to_simple_string(tl) << std::endl;
|
|
local_date_time ldt1 = local_sec_clock::local_time(az_tz);
|
|
std::cout << ldt1.to_string() << std::endl;
|
|
local_date_time ldt2 = local_sec_clock::local_time(ny_tz);
|
|
std::cout << ldt2.to_string() << std::endl;
|
|
|
|
tl = microsec_clock::local_time();
|
|
std::cout << to_simple_string(tl) << std::endl;
|
|
local_date_time ldt3 = local_microsec_clock::local_time(az_tz);
|
|
std::cout << ldt3.to_string() << std::endl;
|
|
local_date_time ldt4 = local_microsec_clock::local_time(ny_tz);
|
|
std::cout << ldt4.to_string() << std::endl;
|
|
|
|
return 0;
|
|
}
|