|
|
| version 1.96, 2015/09/21 22:37:36 | version 1.99, 2015/10/26 01:21:53 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b date parser class. | Parser: @b date parser class. |
| Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) | Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| */ | */ |
| Line 50 Table date_calendar_table_template(new D | Line 50 Table date_calendar_table_template(new D |
| static void _now(Request& r, MethodParams& params) { | static void _now(Request& r, MethodParams& params) { |
| VDate& vdate=GET_SELF(r, VDate); | VDate& vdate=GET_SELF(r, VDate); |
| time_t t=time(0); | pa_time_t t=(pa_time_t)time(0); |
| if(params.count()==1) // ^now(offset) | if(params.count()==1) // ^now(offset) |
| t+=(time_t)round(params.as_double(0, "offset must be double", r)*SECS_PER_DAY); | t+=(pa_time_t)round(params.as_double(0, "offset must be double", r)*SECS_PER_DAY); |
| vdate.set_time(t); | vdate.set_time(t); |
| } | } |
| Line 160 static char *numeric_tz(char prefix, cha | Line 160 static char *numeric_tz(char prefix, cha |
| char *buf=new(PointerFreeGC) char[size]; | char *buf=new(PointerFreeGC) char[size]; |
| strcpy(buf, prefix=='+' ? "SUB-":"SUB+"); | strcpy(buf, prefix=='+' ? "SUB-":"SUB+"); |
| strncpy(buf+4, tz, cur-tz); | strncpy(buf+4, tz, cur-tz); |
| buf[size]=0; | buf[size-1]=0; |
| return buf; | return buf; |
| } | } |