forked from valyagolev/leave-vk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logging of album/photo counters, extract directory creation to a …
…utility function
- Loading branch information
Showing
2 changed files
with
52 additions
and
39 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,7 +1,15 @@ | ||
import datetime | ||
import pytz | ||
import os | ||
|
||
def timestamp_to_moscow_datetime(ts): | ||
local_tz = pytz.timezone('Europe/Moscow') | ||
dt = datetime.datetime.utcfromtimestamp(ts).replace(tzinfo=datetime.timezone.utc) | ||
return dt.astimezone(local_tz) | ||
return dt.astimezone(local_tz) | ||
|
||
def create_dir(dir): | ||
try: | ||
os.makedirs(dir) | ||
except FileExistsError: | ||
# print('directory %s already exists, skipping' % dir) | ||
pass |