From a807d3e6b70e89ffb7981bfbbf1ebfd9229be203 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 6 Sep 2022 14:35:11 -0700 Subject: [PATCH] Create function gnc_tm_get_today_neutral. To complement gnc_tm_get_today_begin and gnc_tm_get_today_end. --- libgnucash/engine/gnc-date.cpp | 6 ++++++ libgnucash/engine/gnc-date.h | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libgnucash/engine/gnc-date.cpp b/libgnucash/engine/gnc-date.cpp index e7686463ee..06916b14fc 100644 --- a/libgnucash/engine/gnc-date.cpp +++ b/libgnucash/engine/gnc-date.cpp @@ -1334,6 +1334,12 @@ gnc_tm_get_today_start (struct tm *tm) gnc_tm_get_day_start(tm, time(NULL)); } +void +gnc_tm_get_today_neutral (struct tm *tm) +{ + gnc_tm_get_day_neutral(tm, time(NULL)); +} + void gnc_tm_get_today_end (struct tm *tm) { diff --git a/libgnucash/engine/gnc-date.h b/libgnucash/engine/gnc-date.h index d2ec8298ec..d2da7be275 100644 --- a/libgnucash/engine/gnc-date.h +++ b/libgnucash/engine/gnc-date.h @@ -576,7 +576,7 @@ void gnc_tm_set_day_end (struct tm *tm) time64 gnc_time64_get_day_start(time64 time_val); /** The gnc_time64_get_day_neutral() routine will take the given time in - * seconds and adjust it to 10:59am of that day. */ + * seconds and adjust it to 10:59:00Z of that day. */ time64 gnc_time64_get_day_neutral(time64 time_val); /** The gnc_time64_get_day_end() routine will take the given time in @@ -596,6 +596,10 @@ int gnc_date_get_last_mday (int month, int year); * tm and fills it in with the first second of the today. */ void gnc_tm_get_today_start(struct tm *tm); +/** The gnc_tm_get_today_start() routine takes a pointer to a struct + * tm and fills it in with the timezone neutral time (10:59:00Z). */ +void gnc_tm_get_today_neutral(struct tm *tm); + /** The gnc_tm_get_today_end() routine takes a pointer to a struct * tm and fills it in with the last second of the today. */ void gnc_tm_get_today_end(struct tm *tm);