# Include ".. /tmain. HPP "Void test_datetime () {using poco: localdatetime; using poco: datetime; using poco: datetimeformat; using poco: datetimeformatter; using poco: datetimeparser; localdatetime now; // 2005-01-01t12: 00: 00 + 01: 00 // 2005-01-01t11: 00: 00 zstd: String str_iso = datetimeformatter: Format (now, datetimeformat: iso8601_format ); print_debug (str_iso); // sat, 01 Jan 2005 12:00:00 + 0100 // sat, 01 Jan 2005 11:00:00 gmtstd: String str_http = datetimeformatter: Format (now, datetimeformat :: http_format); print_debug (str_http); // The date/time format produced by the ansi c asctime () function. // sat Jan 1 12:00:00 2005std: String str_asctime = datetimeformatter: Format (now, datetimeformat: asctime_format); print_debug (str_asctime); // a simple, sortable date/time format. // 2005-01-01 12: 00: 00std: String str_simple = datetimeformatter: Format (now, datetimeformat: sortable_format); print_debug (str_simple); print_debug (now. year (); print_debug (now. month (); print_debug (now. day (); print_debug (now. dayofweek (); print_debug (now. dayofyear (); print_debug (now. julianday (); print_debug (datetimeformat: weekday_names [now. dayofweek ()]); print_debug (datetimeformat: month_names [now. month ()-1]); // parse the time format datetime DT; int TZD; datetimeparser: parse (datetimeformat: iso8601_format, str_iso, DT, TZD); DT. makeutc (TZD); localdatetime LDT (TZD, DT );}