-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shawnsdaddy
committed
May 30, 2023
1 parent
8be705f
commit c2c249a
Showing
2 changed files
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
from datetime import datetime | ||
import pytz | ||
|
||
|
||
def the_same_day(a: datetime = None, b: datetime = None) -> bool: | ||
if a is None or b is None: | ||
return False | ||
return a.year == b.year and a.month == b.month and a.day == b.day | ||
|
||
|
||
def the_same_time(a: datetime = None, b: datetime = None) -> bool: | ||
if a is None or b is None: | ||
return False | ||
return a.year == b.year and a.month == b.month and a.day == b.day and a.hour ==b.hour and a.minute==b.minute | ||
return abs(a - b).total_seconds() < 1.5 | ||
|
||
|
||
def get_server_weekday(): | ||
return datetime.now(pytz.timezone('Asia/Dubai')).weekday() | ||
return datetime.now(pytz.timezone('Asia/Dubai')).weekday() |