alexa

How to convert date string from database in python ?

How to convert date string from database in python ?

the datetime.fromtimestamp function converts a date in posix format (a 32bit integer) to a local date format.

Return the local date and time corresponding to the POSIX timestamp, such as is returned by time.time(). If optional argument tz is None or not specified, the timestamp is converted to the platform’s local date and time, and the returned datetime object is naive.

If your date is in string format, use the function datetime.strptime(date_time_str, format)


194 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online

Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry