comparison src/c/urweb.c @ 1449:0982f0242776

Remove commented-out readUtc code; add back indeterminate tm_isdst
author Adam Chlipala <adam@chlipala.net>
date Fri, 15 Apr 2011 16:49:46 -0400
parents 37599e85bba8
children b6ce8ef0ea88
comparison
equal deleted inserted replaced
1448:37599e85bba8 1449:0982f0242776
3747 3747
3748 uw_Basis_bool uw_Basis_le_time(uw_context ctx, uw_Basis_time t1, uw_Basis_time t2) { 3748 uw_Basis_bool uw_Basis_le_time(uw_context ctx, uw_Basis_time t1, uw_Basis_time t2) {
3749 return !!(uw_Basis_eq_time(ctx, t1, t2) || uw_Basis_lt_time(ctx, t1, t2)); 3749 return !!(uw_Basis_eq_time(ctx, t1, t2) || uw_Basis_lt_time(ctx, t1, t2));
3750 } 3750 }
3751 3751
3752 /*uw_Basis_time *uw_Basis_readUtc(uw_context ctx, uw_Basis_string s) {
3753 uw_Basis_time *r = uw_Basis_stringToTime(ctx, s);
3754
3755 printf("timezone = %ld\n", timezone);
3756
3757 if (r)
3758 r->seconds -= timezone;
3759
3760 return r;
3761 }*/
3762
3763 uw_Basis_time *uw_Basis_readUtc(uw_context ctx, uw_Basis_string s) { 3752 uw_Basis_time *uw_Basis_readUtc(uw_context ctx, uw_Basis_string s) {
3764 struct tm stm = {}; 3753 struct tm stm = {};
3765 char *end = strchr(s, 0); 3754 char *end = strchr(s, 0);
3755 stm.tm_isdst = -1;
3766 3756
3767 if (strptime(s, TIME_FMT_PG, &stm) == end || strptime(s, TIME_FMT, &stm) == end) { 3757 if (strptime(s, TIME_FMT_PG, &stm) == end || strptime(s, TIME_FMT, &stm) == end) {
3768 uw_Basis_time *r = uw_malloc(ctx, sizeof(uw_Basis_time)); 3758 uw_Basis_time *r = uw_malloc(ctx, sizeof(uw_Basis_time));
3769 3759
3770 r->seconds = timegm(&stm); 3760 r->seconds = timegm(&stm);