[gnote] Add method add_seconds to DateTime
- From: Aurimas Äernius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Add method add_seconds to DateTime
- Date: Thu, 5 Jul 2012 20:31:09 +0000 (UTC)
commit 1136f193a6fb4c016e5bddcae98ac926ca370571
Author: Aurimas Äernius <aurisc4 gmail com>
Date: Thu Jul 5 23:15:04 2012 +0300
Add method add_seconds to DateTime
src/sharp/datetime.cpp | 6 ++++++
src/sharp/datetime.hpp | 3 ++-
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/sharp/datetime.cpp b/src/sharp/datetime.cpp
index 917792b..82fb400 100644
--- a/src/sharp/datetime.cpp
+++ b/src/sharp/datetime.cpp
@@ -67,6 +67,12 @@ namespace sharp {
return *this;
}
+ DateTime & DateTime::add_seconds(int seconds)
+ {
+ m_date.add_seconds(seconds);
+ return *this;
+ }
+
int DateTime::day() const
{
struct tm result;
diff --git a/src/sharp/datetime.hpp b/src/sharp/datetime.hpp
index 458d9fb..814fd1c 100644
--- a/src/sharp/datetime.hpp
+++ b/src/sharp/datetime.hpp
@@ -46,9 +46,10 @@ public:
DateTime();
explicit DateTime(time_t t, glong _usec = 0);
explicit DateTime(const Glib::TimeVal & v);
-
+
DateTime & add_days(int days);
DateTime & add_hours(int hours);
+ DateTime & add_seconds(int seconds);
int day() const;
int month() const;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]