/*************************************************************************** * Copyright (C) 2006 by Nicolas PASCAL * * pascal@icare-pc12 * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ /** * @file test_date.cpp do some unit tests on the date.h module * history : * 14/06/2006 : creation */ #include "date.h" int main(int argc, char *argv[]) { Date d,d1,d2; double leap_sec; char format[] = "%Y-%m-%dT%H:%M:%S"; /********** check the string formatting methods **********/ // set a date from a formatted string d1.set_date_str("2007-06-14T16:27:33", format); // get a date as a formatted string cout< day_list=Date::get_days(d1,d2); cout<<"--- days in range "<"<::iterator i=day_list.begin();i!=day_list.end();++i) cout<<*i<<", "; cout<