hook gvariant vectors up to kdbus
[platform/upstream/glib.git] / tests / datetime.c
1 /*
2  * Copyright (C) 2011 Red Hat, Inc.
3  *
4  * This library is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation; either version 2.1 of the
7  * licence, or (at your option) any later version.
8  *
9  * This is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
12  * License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
17  * USA.
18  */
19
20 #include <locale.h>
21 #include <glib/glib.h>
22
23 int
24 main (int argc, char *argv[])
25 {
26   gchar *fmt;
27   GDateTime *dt;
28   gchar *str;
29
30   setlocale (LC_ALL, "");
31
32   if (argc > 1)
33     fmt = argv[1];
34   else
35     fmt = "%x %X";
36
37   dt = g_date_time_new_now_local ();
38   str = g_date_time_format (dt, fmt);
39   g_print ("%s\n", str);
40   g_free (str);
41   g_date_time_unref (dt);
42
43   return 0;
44 }