diff options
author | Constantin Jucovschi <cj@ubuntu.localdomain> | 2009-04-24 07:20:22 -0400 |
---|---|---|
committer | Constantin Jucovschi <cj@ubuntu.localdomain> | 2009-04-24 07:20:22 -0400 |
commit | 8f27e65bddd7d4b8515ce620fb485fdd78fcdf89 (patch) | |
tree | bd328a4dd4f92d32202241b5e3a7f36177792c5f /time/akg_localtime.cc | |
download | rasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.tar.gz rasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.tar.xz rasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.zip |
Initial commitv8.0
Diffstat (limited to 'time/akg_localtime.cc')
-rw-r--r-- | time/akg_localtime.cc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/time/akg_localtime.cc b/time/akg_localtime.cc new file mode 100644 index 0000000..0831cbc --- /dev/null +++ b/time/akg_localtime.cc @@ -0,0 +1,60 @@ +/* +* This file is part of rasdaman community. +* +* Rasdaman community 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 3 of the License, or +* (at your option) any later version. +* +* Rasdaman community 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 rasdaman community. If not, see <http://www.gnu.org/licenses/>. +* +* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / +rasdaman GmbH. +* +* For more information please see <http://www.rasdaman.org> +* or contact Peter Baumann via <baumann@rasdaman.com>. +*/ + +/* + * 2007-feb-07 PB #include <akgtime.hh> -> "akgtime.hh" + */ + +#include "akgtime.hh" +#include <iomanip> + +using namespace akg; + + +LocalTime::LocalTime() throw() + { + now(); + } + +void LocalTime::now() throw() + { + //gettimeofday(&value,NULL); + value = time(NULL); + } + +std::ostream& akg::operator<<(std::ostream &os, const LocalTime <) + { + struct tm broken; + + localtime_r(<.value, &broken); + + os<<std::setw(2)<<broken.tm_mday<<'.'; + os<<std::setw(2)<<std::setfill('0')<<broken.tm_mon+1; + os<<'.'<<broken.tm_year+1900<<' '; + os<<std::setw(2)<<std::setfill('0')<<broken.tm_hour<<':'; + os<<std::setw(2)<<std::setfill('0')<<broken.tm_min<<':'; + os<<std::setw(2)<<std::setfill('0')<<broken.tm_sec; + + return os; + } + |