From eeac423fd6fd7428275279c6689a76388fcb8818 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 26 Sep 2015 14:20:32 -0400 Subject: [PATCH] ISO8601d: Added ::day --- src/ISO8601.cpp | 7 +++++++ src/ISO8601.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index 881ca3849..e01df077b 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -919,6 +919,13 @@ int ISO8601d::week () const return ISO8601d::weekOfYear (ISO8601d::dayOfWeek (ISO8601d::weekstart)); } +//////////////////////////////////////////////////////////////////////////////// +int ISO8601d::day () const +{ + struct tm* t = localtime (&_date); + return t->tm_mday; +} + //////////////////////////////////////////////////////////////////////////////// void ISO8601p::clear () { diff --git a/src/ISO8601.h b/src/ISO8601.h index 9889da8fd..4e6e9a72d 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -55,6 +55,7 @@ public: int month () const; int week () const; + int day () const; private: void clear ();