Answers for "python datetime json"

11

python datetime string

import datetime

today = datetime.datetime.now()
date_time = today.strftime("%m/%d/%Y, %H:%M:%S")
print("date and time:",date_time)
Posted by: Guest on May-21-2020
2

json dumps datetime

def myconverter(o):
    if isinstance(o, datetime.datetime):
        return o.__str__()

print(json.dumps(d, default = myconverter))
Posted by: Guest on June-23-2020
11

python datetime string

import datetime

today = datetime.datetime.now()
date_time = today.strftime("%m/%d/%Y, %H:%M:%S")
print("date and time:",date_time)
Posted by: Guest on May-21-2020
2

json dumps datetime

def myconverter(o):
    if isinstance(o, datetime.datetime):
        return o.__str__()

print(json.dumps(d, default = myconverter))
Posted by: Guest on June-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language