mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
9383f4c3c6
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22097 a592a061-630c-0410-9148-cb99ea01b6c8
34 lines
570 B
C++
34 lines
570 B
C++
/**
|
|
* \file lyxtime.cpp
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author John Levon
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include "support/lyxtime.h"
|
|
|
|
using namespace std;
|
|
|
|
namespace lyx {
|
|
|
|
time_t current_time()
|
|
{
|
|
return time(0);
|
|
}
|
|
|
|
|
|
string const formatted_time(time_t 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);
|
|
}
|
|
|
|
} // namespace lyx
|