| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

timezone_string

#include "sfldate.h"
char *
timezone_string (void)

Synopsis

Returns a static string containing the time zone as a 4-digit number, with a leading '+' or '-' character. GMT is represented as "+0000"; Central European Time is "+1000". If the system does not support the timezone, returns "+0000".

Source Code - (sfldate.c)

{
#if (defined (TIMEZONE))
    static char
        formatted_string [10];          /*  -nnnn plus null                  */
    int
        minutes;                        /*  TIMEZONE is in seconds           */

    minutes = 0 - (int) (TIMEZONE / 60);
    snprintf (formatted_string, sizeof (formatted_string),
              "%03d%02d", minutes / 60, abs (minutes % 60));
    if (*formatted_string == '0')
        *formatted_string = '+';
    return  (formatted_string);
#else
    return ("+0000");
#endif
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation