Date.cc

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #include <iostream>
00013 //#include "zypp/base/Logger.h"
00014 
00015 #include "zypp/base/String.h"
00016 
00017 #include "zypp/Date.h"
00018 
00019 using std::endl;
00020 
00022 namespace zypp
00023 { 
00024 
00026   //
00027   //    METHOD NAME : Date::Date
00028   //    METHOD TYPE : Constructor
00029   //
00030   Date::Date( const std::string & seconds_r )
00031   { str::strtonum( seconds_r, _date ); }
00032 
00034   //
00035   //    METHOD NAME : Date::form
00036   //    METHOD TYPE : std::string
00037   //
00038   std::string Date::form( const std::string & format_r ) const
00039   {
00040     static char buf[1024];
00041     if ( ! strftime( buf, 1024, format_r.c_str(), localtime( &_date ) ) )
00042       return std::string();
00043     return buf;
00044   }
00045 
00047 } // namespace zypp

Generated on Tue Sep 25 19:23:00 2007 for libzypp by  doxygen 1.5.3