X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ftime%2Futils.cpp;h=ad0d24550338f7c22117057a2354d42f93e6c09e;hp=e8c048084f1861732880b17c5f38cf22cbc567e7;hb=80bbee2f401b4af71cb1b80508bdb0d2bb61fa40;hpb=96b1df89bd5f1721def1fdadb1c3ab16becf2ecd diff --git a/source/time/utils.cpp b/source/time/utils.cpp index e8c0480..ad0d245 100644 --- a/source/time/utils.cpp +++ b/source/time/utils.cpp @@ -1,5 +1,5 @@ /* -This file is part of libmspframework +This file is part of libmspcore Copyright © 2006 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -9,11 +9,14 @@ Distributed under the LGPL #include #include #endif +#include "datetime.h" #include "timedelta.h" #include "timestamp.h" #include "units.h" #include "utils.h" +using namespace std; + namespace Msp { namespace Time { @@ -50,6 +53,11 @@ TimeStamp now() #endif } +string format_now(const string &fmt) +{ + return DateTime(now()).format(fmt); +} + /** Returns the CPU time used by the program so far. */