ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/zoe/trunk/Stamp.cpp
Revision: 27
Committed: 2004-07-17T19:21:04-07:00 (20 years, 11 months ago) by douglas
File size: 462 byte(s)
Log Message:
Feed me!

File Contents

# User Rev Content
1 douglas 21 // Zoe AIM Away Message RSS Feed Generator
2     //
3     // Seth King and Douglas Thrift
4     //
5     // $Id$
6    
7     #include "Stamp.hpp"
8    
9 douglas 27 Stamp::Stamp(const ext::String& when)
10 douglas 21 {
11 douglas 27 strptime(when.NullTerminate(), "%F %T", &stamp);
12 douglas 21 timegm(&stamp);
13     }
14    
15 douglas 25 Stamp::operator ext::String() const
16 douglas 21 {
17     char when[30];
18    
19 douglas 24 std::strftime(when, 30, "%a, %d %b %Y %T GMT", &stamp);
20 douglas 21
21     return when;
22     }
23    
24 douglas 27 Stamp Stamp::operator+(int days) const
25 douglas 21 {
26 douglas 27 std::tm sum(stamp);
27 douglas 21
28 douglas 27 sum.tm_mday += days;
29    
30     return timegm(&sum);
31 douglas 21 }

Properties

Name Value
svn:eol-style native
svn:keywords Id