Commit 66903d61 authored by Christian Lölkes's avatar Christian Lölkes
Browse files

added method to write JSON files

parent 0d836508
import pytz
import json
from datetime import datetime
class Toolbox():
TIMEZONE = pytz.timezone('Europe/Berlin')
@staticmethod
def write_JSON(content, target='content.json'):
with open(target, 'w') as outfile:
outfile.write(json.dumps(content, ensure_ascii = False).encode('utf8'))
outfile.close()
@staticmethod
def utc_time():
now = datetime.utcnow()
......
from ibtoolbox import *
if __name__ == '__main__':
print(Toolbox.local_formatted_time())
print(Toolbox.local_formatted_date())
print(Toolbox.local_formatted_long_date())
print(Toolbox.week_number())
print(Toolbox.local_full_formatted_date())
pass
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment