Changeset 4131

Show
Ignore:
Timestamp:
05/20/06 02:55:28 (3 years ago)
Author:
morris
Message:

Revert automatically to date without timezone on all platforms, if timezone form is not available

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/libwired/data/wi-date.c

    r4051 r4131  
    223223 
    224224wi_date_t * wi_date_init_with_iso8601_string(wi_date_t *date, wi_string_t *string) { 
    225         if(wi_string_length(string) < _WI_DATE_ISO8601_STRING_SIZE) { 
    226                 wi_release(date); 
    227                  
     225        wi_string_t             *substring; 
     226 
     227        wi_release(date); 
     228 
     229        if(wi_string_length(string) < _WI_DATE_ISO8601_STRING_SIZE) 
    228230                return NULL; 
    229         } 
    230  
    231 #ifdef HAVE_GLIBC 
    232         string = wi_string_by_deleting_characters_in_range(string, wi_make_range(19, 6)); 
    233  
    234         return wi_date_init_with_string(date, string, WI_STR("%Y-%m-%dT%H:%M:%S"))
    235 #else 
    236         string = wi_string_by_deleting_characters_in_range(string, wi_make_range(22, 1)); 
    237  
    238         return wi_date_init_with_string(date, string, WI_STR("%Y-%m-%dT%H:%M:%S%z")); 
    239 #endif 
     231 
     232        substring = wi_string_by_deleting_characters_in_range(string, wi_make_range(22, 1)); 
     233        date = wi_date_init_with_string(wi_date_alloc(), substring, WI_STR("%Y-%m-%dT%H:%M:%S%z")); 
     234 
     235        if(date) 
     236               return date
     237 
     238        substring = wi_string_by_deleting_characters_in_range(string, wi_make_range(19, 6)); 
     239        date = wi_date_init_with_string(wi_date_alloc(), substring, WI_STR("%Y-%m-%dT%H:%M:%S")); 
     240 
     241        return date; 
    240242} 
    241243