| 839 do { |
839 do { |
| 840 str++; |
840 str++; |
| 841 } while (*str >= '0' && *str <= '9'); |
841 } while (*str >= '0' && *str <= '9'); |
| 842 } |
842 } |
| 843 |
843 |
| 844 sign = (*str == '+') ? -1 : 1; |
844 sign = (*str == '+') ? 1 : -1; |
| 845 |
845 |
| 846 /* Process the timezone */ |
846 /* Process the timezone */ |
| 847 if (*str == '+' || *str == '-') { |
847 if (*str == '+' || *str == '-') { |
| 848 str++; |
848 str++; |
| 849 |
849 |
| 850 if (((sscanf(str, "%02d:%02d", &tzhrs, &tzmins) == 2 && (str += 5)) || |
850 if (((sscanf(str, "%02d:%02d", &tzhrs, &tzmins) == 2 && (str += 5)) || |
| 851 (sscanf(str, "%02d%02d", &tzhrs, &tzmins) == 2 && (str += 4)))) |
851 (sscanf(str, "%02d%02d", &tzhrs, &tzmins) == 2 && (str += 4)))) |
| 852 { |
852 { |
| |
853 mktime_with_utc = TRUE; |
| 853 tzoff = tzhrs * 60 * 60 + tzmins * 60; |
854 tzoff = tzhrs * 60 * 60 + tzmins * 60; |
| 854 tzoff *= sign; |
855 tzoff *= sign; |
| 855 } else { |
|
| 856 if (rest != NULL && *str != '\0') |
|
| 857 *rest = str; |
|
| 858 |
|
| 859 return 0; |
|
| 860 } |
856 } |
| 861 } else if (*str == 'Z') { |
857 } else if (*str == 'Z') { |
| 862 /* 'Z' = Zulu = UTC */ |
858 /* 'Z' = Zulu = UTC */ |
| 863 str++; |
859 str++; |
| 864 utc = TRUE; |
860 mktime_with_utc = TRUE; |
| 865 } else if (!utc) { |
861 tzoff = 0; |
| 866 /* Local Time */ |
|
| 867 t.tm_isdst = -1; |
|
| 868 mktime_with_utc = FALSE; |
|
| 869 } |
862 } |
| 870 |
863 |
| 871 if (utc) |
864 if (!mktime_with_utc) |
| 872 tzoff = 0; |
865 { |
| |
866 /* No timezone specified. */ |
| |
867 |
| |
868 if (utc) { |
| |
869 mktime_with_utc = TRUE; |
| |
870 tzoff = 0; |
| |
871 } else { |
| |
872 /* Local Time */ |
| |
873 t.tm_isdst = -1; |
| |
874 } |
| |
875 } |
| 873 } |
876 } |
| 874 } |
877 } |
| 875 |
878 |
| 876 if (rest != NULL && *str != '\0') { |
879 if (rest != NULL && *str != '\0') { |
| 877 /* Strip trailing whitespace */ |
880 /* Strip trailing whitespace */ |