Glib convert epoch time to string.
- by PP
I am using glibs functions to convert epoch time to string as follows.
But each time it is giving me some random time.
//Convert Time in string.
GDate *date = g_date_new_julian(timestampsecs);
gchar date_string[50];
g_date_strftime(date_string, 50, (const gchar*)"%a, %I:%M %p", (const GDate*)date);
printf("Date String [%s]\n", date_string );
Why this might be happening? am i missing anything?
Thanks,
PP.