time ctime 28os path getmtime phyton in datetime

Solutions on MaxInterview for time ctime 28os path getmtime phyton in datetime by the best coders in the world

showing results for - "time ctime 28os path getmtime phyton in datetime"
Baptiste
28 Nov 2016
1x = time.strftime("%d.%m.%Y", time.gmtime(os.path.getmtime("{}".format("file.txt"))))
2
3# getctime can be used instead of getmtime
4# getctime = file creation date
5# getmtime = last modified file date
6
7#"file.txt" can also be a filepath if it is in a different directory
8
9# time.strftime("%d.%m.%Y")
10# changes the output date from time.gmtime(...) in a more readable form.
11# %d = day , %m = month, %y = year 
12# . in in my case the seperator but it can be anything, like /
13