Python Forum
Getting Correct Creation Time
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting Correct Creation Time
#9
(Aug-12-2020, 09:00 PM)bowlofred Wrote: Main thing for me, does the os.path.getctime() value agree with dir /t:c?

Here's what I get when I run dir /t:c:
[Image: view?usp=sharing]

Here's what I see in explorer:
[Image: view?usp=sharing]

The dates in Explorer are the actual creation dates; The date and time the photo was taken (which is what I want).

So I've realized that I have 2 problems...

Please understand that I'm reeeeaally new to Python and programming in general. I'm probably setting this up wrong.

1) When I use datetime.fromtimestamp(), I get an error that I haven't loaded it yet. So, I guess my question is... where do I import that from?

right now these are what I'm importing:
import os, datetime
from pathlib import Path
from time import ctime

2) When I use os.path.getctime("IMG_7001.JPG), or str(datetime.fromtimestamp(os.path.getctime("IMG_7001.JPG"))) It returns a "FileNotFound" error.

I think the issue is that I'm not setting up the "where" correctly. Meaning the path the files are located. I was gonna post what I have, but it's getting tangled (I'm throwing code at it to see what sticks) and I think I need to go back to some tutorials and start over.


- John
Reply


Messages In This Thread
Getting Correct Creation Time - by JohnVogel - Aug-10-2020, 04:51 PM
RE: Getting Correct Creation Time - by bowlofred - Aug-10-2020, 05:27 PM
RE: Getting Correct Creation Time - by JohnVogel - Aug-10-2020, 09:41 PM
RE: Getting Correct Creation Time - by Gribouillis - Aug-10-2020, 05:28 PM
RE: Getting Correct Creation Time - by bowlofred - Aug-11-2020, 04:04 AM
RE: Getting Correct Creation Time - by JohnVogel - Aug-12-2020, 08:17 PM
RE: Getting Correct Creation Time - by bowlofred - Aug-12-2020, 09:00 PM
RE: Getting Correct Creation Time - by JohnVogel - Aug-14-2020, 04:06 PM
RE: Getting Correct Creation Time - by JohnVogel - Aug-14-2020, 05:49 PM
RE: Getting Correct Creation Time - by bowlofred - Aug-14-2020, 06:26 PM
RE: Getting Correct Creation Time - by JohnVogel - Aug-14-2020, 06:45 PM
RE: Getting Correct Creation Time - by bowlofred - Aug-14-2020, 08:04 PM
RE: Getting Correct Creation Time - by JohnVogel - Aug-14-2020, 09:30 PM
RE: Getting Correct Creation Time - by bowlofred - Aug-14-2020, 10:21 PM
RE: Getting Correct Creation Time - by JohnVogel - Aug-17-2020, 03:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to acquire an imported file creation time thunderspeed 4 1,969 Sep-23-2021, 04:27 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020