/* * Copyright (c) 1995 Gunther Schadow. All rights reserved. * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "OraDate.h" ora_date::ora_date(void) { set_year(1970); set_month(1); set_day(1); set_hour(0); set_minute(0); set_second(0); } ora_date::ora_date(struct tm &tms) { set_second(tms.tm_sec); set_minute(tms.tm_min); set_hour(tms.tm_hour); set_day(tms.tm_mday); set_month(tms.tm_mon + 1); set_year(tms.tm_year + 1900); } ora_date::operator struct tm () const return tms { tms.tm_sec = get_second(); tms.tm_min = get_minute(); tms.tm_hour = get_hour(); tms.tm_mday = get_day(); tms.tm_mon = get_month() - 1; tms.tm_year = get_year() - 1900; }