CR Feedback
This commit is contained in:
1 parent
883373f7e5
commit
2925cf5092
2 files changed
+11
-11
No files matched your search
@@ -324,20 +324,13 @@ bool is_local_time_sunday() {
|
||||
return now.date().day_of_week() == boost::date_time::Sunday;
|
||||
}
|
||||
bool is_local_time_between(int hh_start, int mm_start, int hh_end, int mm_end) {
|
||||
using namespace boost::posix_time;
|
||||
auto now = local_now();
|
||||
auto hh_now = now.time_of_day().hours();
|
||||
auto mm_now = now.time_of_day().minutes();
|
||||
|
||||
if (hh_now > hh_start && hh_now < hh_end) return true;
|
||||
if (hh_now == hh_start || hh_now == hh_end) {
|
||||
if (mm_now >= mm_start && mm_now <= mm_end) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
auto start = ptime(now.date(), hours(hh_start) + minutes(mm_start));
|
||||
auto end = ptime(now.date(), hours(hh_end) + minutes(mm_end));
|
||||
return (now >= start && now <= end);
|
||||
}
|
||||
|
||||
|
||||
struct UtcTimeStamp {
|
||||
int hour;
|
||||
int min;
|
||||
|
||||
Reference in new issue
Block a user