I am using the .st_birthtime method to get the date of creation of a file.
The result looks like:
1359492652
which I can convert to a more readable format
2013-01-29 21:50:52
using
datetime.datetime.fromtimestamp(statinfo.st_birthtime)
My question is: how can I convert it to YYYYMMDD format? I don't give importance of the hours and minutes. In this example the result should be
20130129
Something like the SELECT CONVERT(VARCHAR(10), @date, 112)
of T-SQL.
I am using Python version 3.5.3 and MacOS.