#include <config.h>
-#include "lyxtime.h"
+#include "support/lyxtime.h"
+#include "lyxrc.h"
+
+using std::string;
namespace lyx {
return time(0);
}
+
+string const formatted_time(time_type t, string const & fmt)
+{
+ struct tm * loc_tm = localtime(&t);
+ char date[50];
+ strftime(date, sizeof(date), fmt.c_str(), loc_tm);
+ return string(date);
+}
+
+
+string const formatted_time(time_type t)
+{
+ return formatted_time(t, lyxrc.date_insert_format);
+}
+
} // namespace lyx