Champak Posted November 15, 2021 Share Posted November 15, 2021 I'm trying to get the date and time a video file was originally taken so I'm using _FileGetProperty from BrewMan. The problem is I don't see seconds in any of the date properties. But when I use _Date_Time_GetFileTime, it has seconds on all of the date properties. Does someone know another UDF that will give me media created, acquired date, or date property with seconds in the time? And just out of curiosity, how does the same property produce two different results between the two UDFs? Thanks. Link to comment Share on other sites More sharing options...
Subz Posted November 15, 2021 Share Posted November 15, 2021 Are you referring to the file created time or metadata, for file you can just use the builtin FileGetTime example: ;~ Get Created Timestamp Local $aFileDate = FileGetTime(@ScriptFullPath, 1, 0) MsgBox(4096, "FileDate", "Year : " & $aFileDate[0] & @CRLF & "Month : " & $aFileDate[1] & @CRLF & "Day : " & $aFileDate[2] & @CRLF & "Hour : " & $aFileDate[3] & @CRLF & "Minutes : " & $aFileDate[4] & @CRLF & "Seconds : " & $aFileDate[5]) Link to comment Share on other sites More sharing options...
Musashi Posted November 15, 2021 Share Posted November 15, 2021 39 minutes ago, Subz said: Are you referring to the file created time or metadata ... ? Considering the post counter of @Champak , I would guess that it is more about metadata . @Champak : Not my area of expertise at all, but would external software, such as ExifTool , be a conceivable solution ? "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Subz Posted November 16, 2021 Share Posted November 16, 2021 (edited) @Musashi you're correct, just re-read the OP, not enough zzz You could use the ExtendedProperty to capture the created date, example: ;~ Melba23: Date_Time_Convert UDF ;~ Download: https://www.autoitscript.com/forum/topic/154684-date_time_convert-bugfix-version-27-may-15/ #include <DTC.au3> Local $oShell = ObjCreate("Shell.Application") Local $sFile = "MediaFile.MOV" Local $sFolder = "C:\MediaFiles\" Local $oFolder = $oShell.NameSpace($sFolder) Local $oFolderItem = $oFolder.Parsename($sFile) Local $sDateEncoded = $oFolderItem.ExtendedProperty("System.Media.DateEncoded") ConsoleWrite($sDateEncoded & @CRLF) Local $sDateFormated = _Date_Time_Convert($sDateEncoded, "yyyyMMddHHmmss", "yyyy/MM/dd hh:mm:ss") MsgBox(4096, $sFile & " Media Created Date", "Media Created : " & $sDateFormated) Edited November 16, 2021 by Subz Link to comment Share on other sites More sharing options...
Champak Posted November 16, 2021 Author Share Posted November 16, 2021 @Musashi, I looked at different Exif tools, but I need something that can batch process random names that need to be programmed and I can't be bothered to learn another language or program to write whatever will be needed. If it was one or two files with a couple variations I would go with an Exif tool. @Subz thanks, but I already went a different route. I used the _FileGetProperty and just used the loop variable within the function to append the count to the end to use as seconds. Didn't really matter if the seconds were accurate, only needed to differentiate videos that might have been recorded within the same minute so I don't end up with duplicate files. I do have another matter however. In renaming the files using filemove, I end up with a new date created. Is there anyway to preserve the original date created? Or a different method of renaming a file that wont change that? Thanks. Link to comment Share on other sites More sharing options...
Nine Posted November 16, 2021 Share Posted November 16, 2021 Instead of trying to preserve the original date, how about you move the file and change the creation to the original date. See FileSetTime in help file... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Link to comment Share on other sites More sharing options...
Musashi Posted November 17, 2021 Share Posted November 17, 2021 13 hours ago, Champak said: I looked at different Exif tools, but I need something that can batch process random names that need to be programmed and I can't be bothered to learn another language or program to write whatever will be needed. Just for the sake of completeness. The ExitTool is apparently also available as a standalone for Windows, usable via commandline parameters, see : https://exiftool.org/ Excerpt : Spoiler Windows Executable: exiftool-12.36.zip (6.4 MB) The stand-alone Windows executable does not require Perl. Just download and un-zip the archive then double-click on "exiftool(-k).exe" to read the application documentation, drag-and-drop files and folders to view meta information, or rename to "exiftool.exe" for command-line use. Runs on all versions of Windows. "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Champak Posted November 17, 2021 Author Share Posted November 17, 2021 @Nine great idea, I don't know how my eyes overshot that, I didn't think to look for that because I thought only mp3 properties could be changed. So since that is possible, is it possible to change any of the other meta data/extended properties in a video file? I did a search and it seems the last time someone could do it was pre win10. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now