--- parser3/src/classes/date.C 2004/04/08 11:26:54 1.66 +++ parser3/src/classes/date.C 2005/03/23 08:50:04 1.69 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_DATE_C="$Date: 2004/04/08 11:26:54 $"; +static const char * const IDENT_DATE_C="$Date: 2005/03/23 08:50:04 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -79,7 +79,7 @@ static int to_tm_year(int iyear) { "empty string is not valid datetime"); char *cur=cstr; - int date_delim=isdigit(cur[0])&&isdigit(cur[1])&&isdigit(cur[2])&&isdigit(cur[3])&&cur[4]==':'?':' + int date_delim=isdigit((unsigned char)cur[0])&&isdigit((unsigned char)cur[1])&&isdigit((unsigned char)cur[2])&&isdigit((unsigned char)cur[3])&&cur[4]==':'?':' :'-'; const char* year=lsplit(&cur, date_delim); const char* month=lsplit(&cur, date_delim); @@ -118,7 +118,6 @@ date_part_set: static void _create(Request& r, MethodParams& params) { VDate& vdate=GET_SELF(r, VDate); - tm tmIn; if(params.count()==1) { // ^create[2002-04-25 18:14:00] // ^create[18:14:00] @@ -153,8 +152,7 @@ static void _sql_string(Request& r, Meth VDate& vdate=GET_SELF(r, VDate); int size=1+ 4+1+2+1+2 +1+ 2+1+2+1+2 +1 +1; char *buf=new(PointerFreeGC) char[size]; - time_t time=vdate.get_time(); - size=strftime(buf, size, "%Y-%m-%d %H:%M:%S", localtime(&time)); + size=strftime(buf, size, "%Y-%m-%d %H:%M:%S", vdate.get_localtime()); r.write_assign_lang(String(buf, size)); }