[Fixed]-Query Unix time by day in Python

1👍

you can try:

import time
import datetime

timestamp = int(time.time())

# date timestamp
print int(
    time.mktime(
        datetime.date.fromtimestamp(timestamp).timetuple()
    )
)

# iso format date string
print datetime.date.fromtimestamp(timestamp).isoformat()

Leave a comment