Task

Get and set the modification time of a file.




' FB 1.05.0 Win64
 
' This example is taken directly from the FB documentation (see [http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgFiledatetime])
 
#include "vbcompat.bi"  '' to use Format function
 
Dim filename As String, d As Double
 
Print "Enter a filename: "
Line Input filename
 
If FileExists(filename) Then
  Print "File last modified: ";
  d = FileDateTime( filename )
  Print Format( d, "yyyy-mm-dd hh:mm AM/PM" )
Else
  Print "File not found"
End If
 
Sleep