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