]> git.0d.be Git - empathy.git/blob - libempathy/empathy-time.h
empathy-time: port to TP coding style
[empathy.git] / libempathy / empathy-time.h
1 /*
2  * Copyright (C) 2004 Imendio AB
3  * Copyright (C) 2007-2012 Collabora Ltd.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19
20 #ifndef __EMPATHY_TIME_H__
21 #define __EMPATHY_TIME_H__
22
23 #ifndef __USE_XOPEN
24 #define __USE_XOPEN
25 #endif
26 #include <time.h>
27
28 #include <glib.h>
29
30 G_BEGIN_DECLS
31
32 /*
33  * Translators: use your locale preferred time format.
34  * The fields follow the strftime standard:
35  * look at the manual if you need help (man strftime)
36  */
37 #define EMPATHY_TIME_FORMAT_DISPLAY_SHORT _("%H:%M")
38 #define EMPATHY_DATE_FORMAT_DISPLAY_SHORT  _("%a %d %b %Y")
39 #define EMPATHY_TIME_DATE_FORMAT_DISPLAY_SHORT _("%a %d %b %Y, %H:%M")
40
41 gint64  empathy_time_get_current     (void);
42 gchar  *empathy_time_to_string_utc   (gint64 t,
43     const gchar *format);
44 gchar  *empathy_time_to_string_local (gint64 t,
45     const gchar *format);
46 gchar  *empathy_time_to_string_relative (gint64 t);
47 gchar *empathy_duration_to_string (guint seconds);
48
49 G_END_DECLS
50
51 #endif /* __EMPATHY_TIME_H__ */
52