2003-02-08 19:18:01 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
|
|
|
|
* \file lyxtime.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author John Levon
|
2008-11-14 15:58:50 +00:00
|
|
|
|
* \author Jürgen Spitzmüller
|
2003-02-08 19:18:01 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-02-08 19:18:01 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef LYXTIME_H
|
|
|
|
|
#define LYXTIME_H
|
|
|
|
|
|
|
|
|
|
#include <time.h>
|
2005-07-05 09:01:52 +00:00
|
|
|
|
#include <string>
|
|
|
|
|
|
2016-05-03 19:40:28 +00:00
|
|
|
|
#include "strfwd.h"
|
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2011-11-06 17:03:59 +00:00
|
|
|
|
namespace support {
|
2003-02-08 19:18:01 +00:00
|
|
|
|
|
2007-11-29 08:55:43 +00:00
|
|
|
|
time_t current_time();
|
2003-02-08 19:18:01 +00:00
|
|
|
|
|
2005-07-05 09:01:52 +00:00
|
|
|
|
/** Returns a locale-dependent formatting of the date
|
2008-11-14 15:58:50 +00:00
|
|
|
|
* and time encoded in \c time. The \p fmt string
|
2005-07-05 09:01:52 +00:00
|
|
|
|
* holds the formatting arguments of \c strftime.
|
2016-05-03 19:40:28 +00:00
|
|
|
|
* Prefer the function formatted_datetime below.
|
2005-07-05 09:01:52 +00:00
|
|
|
|
*/
|
2007-11-29 08:55:43 +00:00
|
|
|
|
std::string const formatted_time(time_t t, std::string const & fmt);
|
2005-07-05 09:01:52 +00:00
|
|
|
|
|
2016-05-03 19:40:28 +00:00
|
|
|
|
/** Returns a locale-dependent formatting of the date and time encoded in \c t
|
|
|
|
|
* The \p fmt string holds the formatting arguments of QDateTime::toString().
|
|
|
|
|
* If fmt is empty then the formatting of the date and time is itself according
|
|
|
|
|
* to the locale.
|
|
|
|
|
*/
|
|
|
|
|
docstring formatted_datetime(time_t t, std::string const & fmt = "");
|
|
|
|
|
|
2011-11-06 17:03:59 +00:00
|
|
|
|
/**
|
2013-01-09 12:45:58 +00:00
|
|
|
|
* Inverse of asctime(gmtime()).
|
2011-11-06 17:03:59 +00:00
|
|
|
|
*/
|
2013-01-09 12:45:58 +00:00
|
|
|
|
time_t from_asctime_utc(std::string t);
|
2011-11-06 17:03:59 +00:00
|
|
|
|
|
|
|
|
|
} // namespace support
|
2010-12-16 08:06:00 +00:00
|
|
|
|
} // namespace lyx
|
2003-02-08 19:18:01 +00:00
|
|
|
|
|
|
|
|
|
#endif // LYXTIME_H
|