summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/common.c5
-rw-r--r--lib/common.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/common.c b/lib/common.c
index 2793537..e6bafae 100644
--- a/lib/common.c
+++ b/lib/common.c
@@ -672,6 +672,11 @@ int l2hhmm(time_t t)
return tm.tm_hour * 100 + tm.tm_min;
}
+time_t hhmm2L(int hhmm, time_t offset)
+{
+ return ((hhmm/100) * tmeSecondsPerHour) + ((hhmm%100) * tmeSecondsPerMinute) + offset;
+}
+
//***************************************************************************
// HHMM to Pretty Time
//***************************************************************************
diff --git a/lib/common.h b/lib/common.h
index c8361ec..27c1772 100644
--- a/lib/common.h
+++ b/lib/common.h
@@ -292,6 +292,7 @@ const char* toWeekdayName(uint day);
time_t hhmmOf(time_t t);
int l2hhmm(time_t t);
std::string hhmm2pTime(int hhmm);
+time_t hhmm2L(int hhmm, time_t offset = 0);
time_t midnightOf(time_t t);
std::string l2pTime(time_t t, const char* format = "%d.%m.%Y %T");
std::string l2pDate(time_t t);