/[xlog]/xlog/src/utils.c
ViewVC logotype

Diff of /xlog/src/utils.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by pa4tu, Wed Aug 6 18:18:54 2003 UTC revision 1.14 by pa4tu, Tue Aug 12 13:46:55 2003 UTC
# Line 380  getdate (void) Line 380  getdate (void)
380  {  {
381    time_t current;    time_t current;
382    struct tm *timestruct = NULL;    struct tm *timestruct = NULL;
383    gchar sdatenow[20];    gchar datenow[20], *date;
384            GError *error;
385    
386    time (&current);    time (&current);
387    timestruct = localtime (&current);    timestruct = localtime (&current);
388    strftime (sdatenow, 20, "%d %b %Y", timestruct);    strftime (datenow, 20, "%d %b %Y", timestruct);
389    return (g_strdup (sdatenow));  
390            if (!g_utf8_validate (datenow, -1, NULL ))
391            {
392                    date = g_locale_to_utf8 (datenow, -1, NULL, NULL, &error);
393                    if (!date)
394                    {
395                            g_print (_("Unable to convert '%s' to UTF-8: %s"), datenow,
396                                            error->message);
397                            g_error_free (error);
398                    }
399            }
400            else date = g_strdup (datenow);
401            
402      return (date);
403  }  }
404    
405  /* get the current time, returned value has to be freed */  /* get the current time, returned value has to be freed */

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26