Merge branch 'master' of github.com:bytemaster/fc
This commit is contained in:
commit
018d2c43e0
2 changed files with 4 additions and 1 deletions
|
|
@ -97,6 +97,9 @@ set( sources
|
||||||
|
|
||||||
add_subdirectory(vendor)
|
add_subdirectory(vendor)
|
||||||
|
|
||||||
|
add_executable( date t.cpp )
|
||||||
|
target_link_libraries( date fc ${Boost_THREAD_LIBRARY} ${Boost_CONTEXT_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_CHRONO_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${rt_library} ${Boost_DATE_TIME_LIBRARY})
|
||||||
|
|
||||||
setup_library( fc SOURCES ${sources} )
|
setup_library( fc SOURCES ${sources} )
|
||||||
|
|
||||||
#setup_executable( json_rpc_test SOURCES tests/json_rpc_test.cpp LIBRARIES fc ${ZLIB_LIBRARY} ${pthread_library} ${rt_library} ${Boost_THREAD_LIBRARY} ${Boost_CONTEXT_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_CHRONO_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${rt_library} ${Boost_DATE_TIME_LIBRARY})
|
#setup_executable( json_rpc_test SOURCES tests/json_rpc_test.cpp LIBRARIES fc ${ZLIB_LIBRARY} ${pthread_library} ${rt_library} ${Boost_THREAD_LIBRARY} ${Boost_CONTEXT_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_CHRONO_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${rt_library} ${Boost_DATE_TIME_LIBRARY})
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace fc {
|
||||||
bch::system_clock::time_point tp;
|
bch::system_clock::time_point tp;
|
||||||
tp += bch::microseconds( elapsed._count);
|
tp += bch::microseconds( elapsed._count);
|
||||||
time_t tt = bch::system_clock::to_time_t(tp);
|
time_t tt = bch::system_clock::to_time_t(tp);
|
||||||
return boost::posix_time::to_iso_string( boost::posix_time::from_time_t(tt) );
|
return boost::posix_time::to_iso_string( boost::posix_time::from_time_t(tt) + boost::posix_time::microseconds( elapsed._count - tt*1000000 ));
|
||||||
}
|
}
|
||||||
time_point time_point::from_iso_string( const fc::string& s ) {
|
time_point time_point::from_iso_string( const fc::string& s ) {
|
||||||
auto pt = boost::posix_time::from_iso_string(s);
|
auto pt = boost::posix_time::from_iso_string(s);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue