Glib convert epoch time to string.

Posted by PP on Stack Overflow See other posts from Stack Overflow or by PP
Published on 2010-04-26T06:55:05Z Indexed on 2010/04/26 8:23 UTC
Read the original article Hit count: 270

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about glib

Related posts about c