1

I know that

time.time() 

can be used to make the time system more precise and

time.ctime(os.stat("c:/a1.txt").st_ctime)

can be used to get the creation time of the file. But it can the precision is too low, only to the unit of second.

Can these two ways be combined together?

12
  • If you generate the file by yourself, then you could always add the milliseconds as part of your file name Commented Mar 5, 2016 at 11:54
  • 1
    Sadly not, as far as I am aware, you would need to specify precise timings yourself in the files, and if they were not specified, you will have to make do with that precision. If you tell us the context, or link to a new question outlining your problem, we could take a look at some kind of workaround. Commented Mar 5, 2016 at 12:08
  • 1
    Well sadly the .tif format of the tag DateTime follows "YYYY:MM:DD HH:MM:SS", and that means there is no way to get a timing more precise than within the accuracy of a second. There could be a second file with the precise timing put together with it, but this won't work for a file you haven't generated/created. There is no answer here (As far as I am aware), but from what I Read off the Interne-, I MEAN know, you are sadly out of luck Commented Mar 5, 2016 at 12:24
  • 2
    I found a way, use os.stat("C:/a1.tif").st_ctime_ns can gain nanoseconds level @That One Random Scrub Commented Mar 5, 2016 at 12:28
  • 1
    Well I have been proven a moron once again, I suppose this question is closed. Commented Mar 5, 2016 at 12:32

1 Answer 1

1

use os.stat("C:/a1.tif").st_ctime_ns can gain nanoseconds level

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.