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 27 by douglas, 2004-07-17T19:21:04-07:00 vs.
Revision 39 by douglas, 2004-07-23T17:52:53-07:00

# Line 9 | Line 9
9   Stamp::Stamp(const ext::String& when)
10   {
11          strptime(when.NullTerminate(), "%F %T", &stamp);
12 <        timegm(&stamp);
12 >
13 >        this->when = timegm(&stamp);
14   }
15  
16 < Stamp::operator ext::String() const
16 > ext::String Stamp::get822() const
17   {
18          char when[30];
19  
# Line 21 | Line 22 | Stamp::operator ext::String() const
22          return when;
23   }
24  
25 < Stamp Stamp::operator+(int days) const
25 > ext::String Stamp::getW3() const
26 > {
27 >        char when[21];
28 >
29 >        std::strftime(when, 21, "%FT%TZ", &stamp);
30 >
31 >        return when;
32 > }
33 >
34 > ext::String Stamp::getDate() const
35 > {
36 >        char date[11];
37 >
38 >        std::strftime(date, 11, "%m/%d/%Y", &stamp);
39 >
40 >        return date;
41 > }
42 >
43 > ext::String Stamp::getTime() const
44   {
45 <        std::tm sum(stamp);
45 >        char time[12];
46  
47 <        sum.tm_mday += days;
47 >        std::strftime(time, 12, "%I:%M:%S %p", &stamp);
48  
49 <        return timegm(&sum);
49 >        return time;
50 > }
51 >
52 > void Stamp::setSeconds(int seconds)
53 > {
54 >        stamp.tm_sec = seconds;
55 >        when = timegm(&stamp);
56 > }
57 >
58 > void Stamp::setMinutes(int minutes)
59 > {
60 >        stamp.tm_min = minutes;
61 >        when = timegm(&stamp);
62 > }
63 >
64 > Stamp::operator ext::String() const
65 > {
66 >        char when[24];
67 >
68 >        std::strftime(when, 24, "%F %T GMT", &stamp);
69 >
70 >        return when;
71   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines