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

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

Properties

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