get file date in tcl

Quick Code:
This is a simple tcl script procedure to get the date of a file. The return value is a list containing time in seconds and human readable time in string.

Usage:¬†getFileDate “/docs/sample/test.txt”
Git: git clone (added in g_file_utility.tcl)
Or check the code below

proc gGetFileDate { filePass } {
    set secTime [file mtime $filePass]
    set humanTime [clock format $secTime -format "%d_%b_%y_%H:%M:%S"]
    return [list $secTime $humanTime]

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.