PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example 1: Retrieving the different dates and times associated with a file
  • Example 2: Modifying the creation date of a file
  • Example 1: Retrieving the different dates and times associated with a file
  • Example 2: Modifying the date and time of file creation
fDateTime (Example)
Example 1: Retrieving the different dates and times associated with a file
Reports and Queries The following code is used to find out the different dates and times associated with a file.
// Declare the variables
ResDateTimeCreation is string
ResDateTimeModification is string
ResDateTimeAccess is string
FilePath is string
// Select a file
FilePath = "C:\MyDirectories\File.txt"
// Retrieve the different dates associated with a file
ResDateTimeCreation = fDateTime(FilePath, "", fCreation)
ResDateTimeModification = fDateTime(FilePath, "", fModification)
ResDateTimeAccess fDateTime(FilePath, "", fAccess)
IF ResDateTimeCreation <> "" AND ResDateTimeModification <> "" AND ResDateTimeAccess <> "" THEN
// Display the different dates and times associated with a file
Info("The creation date and time are: " + ResDateTimeCreation + CR + ...
"The modification date and time are: " + ResDateTimeModification + CR + ...
"The access date and time are: "+ ResDateTimeAccess)
ELSE
// Display an error message if the retrieval was not performed
Error(ErrorInfo(errMessage))
END
Example 2: Modifying the creation date of a file
Reports and Queries The following code is used to modify the creation date of a file by the system date of the computer.
// Declare the variables
ResDateTimeCreation is string
ResDateTimeSystem is string
FileTimePath is string
// Select a file
FilePath = "C:\MyDirectories\File.txt"
// Retrieve the system date and time
ResDateTimeSystem = DateSys() + TimeSys()
// Modify the creation date of the selected file
ResDateTimeCreation = fDateTime(FilePath, ResDateTimeSystem, fCreation)
IF ResDateTimeCreation <> "" THEN
// Display the creation date
Info("The creation date and time are now: " + ResDateTimeCreation)
ELSE
// Display an error message if the retrieval was not performed
Error(ErrorInfo(errMessage))
END
Example 1: Retrieving the different dates and times associated with a file
Example 2: Modifying the date and time of file creation
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment