diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-06-09 18:13:00 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-06-09 18:13:00 (GMT) |
commit | 8858521436a302d366b437828128717aaa2cde57 (patch) | |
tree | 86a4658217f11ba8b42097553f62f7b64b3d27cb /Swiften/Base/DateTime.h | |
parent | 1cea8b4c47e8b03aea7e452fb49b8dea3233eb36 (diff) | |
download | swift-contrib-8858521436a302d366b437828128717aaa2cde57.zip swift-contrib-8858521436a302d366b437828128717aaa2cde57.tar.bz2 |
DateTime refactoring.
Moved DateTime serializing into Base.
Fixed a bug when XEP82 dates are non-UTC.
Added unit tests.
Diffstat (limited to 'Swiften/Base/DateTime.h')
-rw-r--r-- | Swiften/Base/DateTime.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Swiften/Base/DateTime.h b/Swiften/Base/DateTime.h index 309ee56..2407ddc 100644 --- a/Swiften/Base/DateTime.h +++ b/Swiften/Base/DateTime.h @@ -10,8 +10,13 @@ namespace Swift { /** - * Converts a date formatted according to XEP-0082 into a time - * object. + * Converts a date formatted according to XEP-0082 into a ptime + * object (in UTC). */ boost::posix_time::ptime stringToDateTime(const std::string& string); + + /** + * Converts a UTC ptime object to a XEP-0082 formatted string. + */ + std::string dateTimeToString(const boost::posix_time::ptime& time); } |