|
|
| version 1.85, 2009/05/15 06:59:33 | version 1.89, 2010/10/21 15:06:27 |
|---|---|
| Line 19 static const char * const IDENT_DATE_C=" | Line 19 static const char * const IDENT_DATE_C=" |
| class MDate: public Methoded { | class MDate: public Methoded { |
| public: // VStateless_class | public: // VStateless_class |
| Value* create_new_value(Pool&, HashStringValue&) { return new VDate(0); } | Value* create_new_value(Pool&) { return new VDate(0); } |
| public: | public: |
| MDate(); | MDate(); |
| public: // Methoded | |
| bool used_directly() { return true; } | |
| }; | }; |
| // global variable | // global variable |
| Line 154 static void _create(Request& r, MethodPa | Line 152 static void _create(Request& r, MethodPa |
| static void _sql_string(Request& r, MethodParams&) { | static void _sql_string(Request& r, MethodParams&) { |
| VDate& vdate=GET_SELF(r, VDate); | 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]; | |
| size=strftime(buf, size, "%Y-%m-%d %H:%M:%S", &vdate.get_localtime()); | |
| r.write_assign_lang(String(buf)); | r.write_assign_lang(*vdate.get_sql_string()); |
| } | } |
| static void _gmt_string(Request& r, MethodParams&) { | static void _gmt_string(Request& r, MethodParams&) { |
| VDate& vdate=GET_SELF(r, VDate); | VDate& vdate=GET_SELF(r, VDate); |
| time_t when=vdate.get_time(); | r.write_assign_lang(*vdate.get_gmt_string()); |
| r.write_assign_lang(String(date_gmt_string(gmtime(&when)))); | |
| } | } |
| static void _roll(Request& r, MethodParams& params) { | static void _roll(Request& r, MethodParams& params) { |