From cf9d0332f6b4dcd7dc388133ffd8fd6edd07e1c1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 16 May 2017 17:44:28 +0300 Subject: Add to_string(timestamp) --- libbutl/timestamp.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libbutl/timestamp.cxx') diff --git a/libbutl/timestamp.cxx b/libbutl/timestamp.cxx index 1f12f41..cf84dd5 100644 --- a/libbutl/timestamp.cxx +++ b/libbutl/timestamp.cxx @@ -10,6 +10,7 @@ #include // tm, time_t, mktime() #include // strtoull() #include +#include #include // put_time(), setw(), dec, right #include // strlen(), memcpy() #include @@ -219,6 +220,17 @@ namespace butl return os; } + string + to_string (const timestamp& ts, + const char* format, + bool special, + bool local) + { + ostringstream o; + to_stream (o, ts, format, special, local); + return o.str (); + } + ostream& operator<< (ostream& os, const duration& d) { @@ -338,7 +350,6 @@ extern "C" #include // tm #include #include -#include #include #include // strlen() -- cgit v1.1