diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-12-31 09:49:37 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-12-31 14:17:26 +0100 |
commit | 894e59865376fdb0e681852ed4337ede89773525 (patch) | |
tree | 15055b6f7be536517b98fd552cdf9c20516b301d /module | |
parent | [Crypter] Fix folder_per_package setting (diff) | |
download | pyload-894e59865376fdb0e681852ed4337ede89773525.tar.xz |
[misc] Check utc type for seconds_to_midnight
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/internal/misc.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/module/plugins/internal/misc.py b/module/plugins/internal/misc.py index 2a5898166..08e4a5daa 100644 --- a/module/plugins/internal/misc.py +++ b/module/plugins/internal/misc.py @@ -658,10 +658,10 @@ def seconds_to_nexthour(strict=False): def seconds_to_midnight(utc=None, strict=False): - if utc is None: - now = datetime.datetime.today() - else: + if type(utc) is int: now = datetime.datetime.utcnow() + datetime.timedelta(hours=utc) + else: + now = datetime.datetime.today() midnight = now.replace(hour=0, minute=0 if strict else 1, second=0, microsecond=0) + datetime.timedelta(days=1) |