ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/zoe/trunk/Stamp.cpp
(Generate patch)

Comparing trunk/Stamp.cpp (file contents):
Revision 24 by douglas, 2004-07-17T13:56:58-07:00 vs.
Revision 36 by douglas, 2004-07-22T01:19:40-07:00

# Line 6 | Line 6
6  
7   #include "Stamp.hpp"
8  
9 Stamp::Stamp(int day, int month, int year, int hour, int minute, int second)
10 {
11        stamp.tm_mday = day;
12        stamp.tm_mon = month;
13        stamp.tm_year = year;
14        stamp.tm_hour = hour;
15        stamp.tm_min = minute;
16        stamp.tm_sec = second;
17
18        timegm(&stamp);
19 }
20
9   Stamp::Stamp(const ext::String& when)
10   {
11 <        strptime(when.NullTerminate(), "%a, %d %b %Y %T %Z", &stamp);
11 >        strptime(when.NullTerminate(), "%F %T", &stamp);
12 >
13 >        this->when = timegm(&stamp);
14   }
15  
16 < Stamp::operator ext::String()
16 > ext::String Stamp::get822() const
17   {
18          char when[30];
19  
# Line 32 | Line 22 | Stamp::operator ext::String()
22          return when;
23   }
24  
25 < Stamp Stamp::operator+(Stamp stamp)
25 > ext::String Stamp::getW3() const
26   {
27 <        return timegm(&this->stamp) + timegm(&stamp.stamp);
38 < }
27 >        char when[21];
28  
29 < Stamp Stamp::operator-(Stamp stamp)
30 < {
31 <        return std::time_t(difftime(timegm(&this->stamp), timegm(&stamp.stamp)));
29 >        std::strftime(when, 21, "%FT%TZ", &stamp);
30 >
31 >        return when;
32   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines