Description: |
call:ftime JD filename attr |
Dependencies: |
:jdate |
Script: |
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14.
|
:ftime JD filename attr -- returns the file time in julian days
:: -- JD [out] - valref file time in julian days
:: -- attr [in,opt] - time field to be used, creation/last-access/last-write, see 'dir /?', i.e. /tc, /ta, /tw, default is /tw
:$created 20060101 :$changed 20090322 :$categories DateAndTime
:$source https://www.dostips.com
SETLOCAL
set file=%~2
set attr=%~3
if not defined attr (call:jdate JD "- %~t2"
) ELSE (for /f %%a in ('"dir %attr% /-c "%file%"|findstr "^^[0-9]""') do call:jdate JD "%%a")
( ENDLOCAL & REM RETURN VALUES
IF "%~1" NEQ "" (SET %~1=%JD%) ELSE (echo.%JD%)
)
EXIT /b
|
|