]> git.lyx.org Git - lyx.git/blob - src/support/lyxtime.h
Remove updateInfo() calls in favor of doing the relevant work
[lyx.git] / src / support / lyxtime.h
1 // -*- C++ -*-
2 /**
3  * \file lyxtime.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  * \author Jürgen Spitzmüller
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef LYXTIME_H
14 #define LYXTIME_H
15
16 #include <time.h>
17 #include <string>
18
19 #include "strfwd.h"
20
21
22 namespace lyx {
23 namespace support {
24
25 time_t current_time();
26
27 /** Returns a locale-dependent formatting of the date
28  *  and time encoded in \c time. The \p fmt string
29  *  holds the formatting arguments of \c strftime.
30  *  Prefer the function formatted_datetime below.
31  */
32 std::string const formatted_time(time_t t, std::string const & fmt);
33
34 /** Returns a locale-dependent formatting of the date and time encoded in \c t
35  *  The \p fmt string holds the formatting arguments of QDateTime::toString().
36  *  If fmt is empty then the formatting of the date and time is itself according
37  *  to the locale.
38  */
39 docstring formatted_datetime(time_t t, std::string const & fmt = "");
40
41 /**
42  * Inverse of asctime(gmtime()).
43  */
44 time_t from_asctime_utc(std::string t);
45
46 } // namespace support
47 } // namespace lyx
48
49 #endif // LYXTIME_H