Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/File-modification-time/Nim/file-modification-time.nim
Normal file
11
Task/File-modification-time/Nim/file-modification-time.nim
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import os, strutils, times
|
||||
|
||||
if paramCount() == 0: quit(QuitSuccess)
|
||||
let fileName = paramStr(1)
|
||||
|
||||
# Get and display last modification time.
|
||||
var mtime = fileName.getLastModificationTime()
|
||||
echo "File \"$1\" last modification time: $2".format(fileName, mtime.format("YYYY-MM-dd HH:mm:ss"))
|
||||
|
||||
# Change last modification time to current time.
|
||||
fileName.setLastModificationTime(now().toTime())
|
||||
Loading…
Add table
Add a link
Reference in a new issue