diff options
Diffstat (limited to 'cpp/src/qpid/sys/windows/Time.cpp')
| -rw-r--r-- | cpp/src/qpid/sys/windows/Time.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cpp/src/qpid/sys/windows/Time.cpp b/cpp/src/qpid/sys/windows/Time.cpp index 2390826831..1d7b94e8d7 100644 --- a/cpp/src/qpid/sys/windows/Time.cpp +++ b/cpp/src/qpid/sys/windows/Time.cpp @@ -72,6 +72,7 @@ std::ostream& operator<<(std::ostream& o, const AbsTime& t) { return o << time_string; } + void toPtime(ptime& pt, const AbsTime& t) { pt = t.getPrivate(); } @@ -87,4 +88,16 @@ void usleep(uint64_t usecs) { ::Sleep(msecs); } +void outputFormattedNow(std::ostream& o) { + ::time_t rawtime; + ::tm timeinfo; + char time_string[100]; + + ::time( &rawtime ); + ::localtime_s(&timeinfo, &rawtime); + ::strftime(time_string, 100, + "%Y-%m-%d %H:%M:%S", + &timeinfo); + o << time_string << " "; +} }} |
