#include <glib.h>
#include <glib/gstdio.h>
#include <locale.h>

main ()
{
  GDateTime *first_day = g_date_time_new_utc (2012, 11, 12, 0, 0, 0.0);
  GDateTime *second_day = g_date_time_add (first_day, G_TIME_SPAN_DAY);

  printf ("C locale\n--------\n");
  printf ("first_day %%a:  %s\n", g_date_time_format (first_day, "%a"));
  printf ("first_day %%A:  %s\n", g_date_time_format (first_day, "%A"));
  printf ("first_day %%c:  %s\n", g_date_time_format (first_day, "%c"));

  printf ("second_day %%a: %s\n", g_date_time_format (second_day, "%a"));
  printf ("second_day %%A: %s\n", g_date_time_format (second_day, "%A"));
  printf ("second_day %%c: %s\n", g_date_time_format (second_day, "%c"));

  setlocale (LC_TIME, "sv_SE.UTF-8");

  printf ("\nSwedish locale\n--------------\n");
  printf ("first_day %%a:  %s\n", g_date_time_format (first_day, "%a"));
  printf ("first_day %%A:  %s\n", g_date_time_format (first_day, "%A"));
  printf ("first_day %%c:  %s\n", g_date_time_format (first_day, "%c"));

  printf ("second_day %%a: %s\n", g_date_time_format (second_day, "%a"));
  printf ("second_day %%A: %s\n", g_date_time_format (second_day, "%A"));
  printf ("second_day %%c: %s\n", g_date_time_format (second_day, "%c"));
}

