|
|
| version 1.29, 2002/04/25 14:40:24 | version 1.30, 2002/05/15 08:58:00 |
|---|---|
| Line 56 static void _create(Request& r, const St | Line 56 static void _create(Request& r, const St |
| if(const String *sdate=params->get(0).get_string()) { // ^create[2002-04-25 18:14:00] | if(const String *sdate=params->get(0).get_string()) { // ^create[2002-04-25 18:14:00] |
| char *cstr=sdate->cstr(); | char *cstr=sdate->cstr(); |
| const char *year=lsplit(&cstr, '-'); | const char *year=lsplit(&cstr, '-'); |
| if(!cstr) // there were no '-' | |
| throw Exception(0, | |
| sdate, | |
| "year&month parts of date abscent, must be in YYYY-NN-DD HH-MM-SS format"); | |
| const char *month=lsplit(&cstr, '-'); | const char *month=lsplit(&cstr, '-'); |
| const char *mday=lsplit(&cstr, ' '); | const char *mday=lsplit(&cstr, ' '); |
| const char *hour=lsplit(&cstr, ':'); | const char *hour=lsplit(&cstr, ':'); |
| Line 306 MDate::MDate(Pool& apool) : Methoded(apo | Line 302 MDate::MDate(Pool& apool) : Methoded(apo |
| // ^now[] | // ^now[] |
| add_native_method("now", Method::CT_DYNAMIC, _now, 0, 1); | add_native_method("now", Method::CT_DYNAMIC, _now, 0, 1); |
| // ^set(float days) | // ^create(float days) |
| add_native_method("create", Method::CT_DYNAMIC, _create, 1, 6); | add_native_method("create", Method::CT_DYNAMIC, _create, 1, 6); |
| // old name for compatibility with <= v1.17 2002/2/18 12:13:42 paf | // old name for compatibility with <= v1.17 2002/2/18 12:13:42 paf |
| add_native_method("set", Method::CT_DYNAMIC, _create, 1, 6); | add_native_method("set", Method::CT_DYNAMIC, _create, 1, 6); |