PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Modifying the date and time associated with a file
  • Managing errors
  • Operating mode in the different operating systems
  • Operating mode in Windows Vista (and later)
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Returns or modifies the different dates associated with a file or directory (creation, modification or access).
In this version, you cannot:
    Versions 18 and later
    Universal Windows 10 App This function is now available in Windows Store apps mode.
    New in version 18
    Universal Windows 10 App This function is now available in Windows Store apps mode.
    Universal Windows 10 App This function is now available in Windows Store apps mode.
    Versions 21 and later
    Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
    New in version 21
    Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
    Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
    WINDEVJavaUser code (UMC)
    // Retrieve the modification date of a file
    ResDate = fDate("C:\MyDirectories\File.txt", "", fModify)
    Syntax
    <Result> = fDate(<File or directory path> [, <New date> [, <Type of date>]])
    <Result>: Character string
    • Date associated with the file or directory (in YYYYMMDD format),
    • Empty string ("") if an error occurred. To find out the error details, use ErrorInfo.
    <File or directory path>: Character string (with quotes)
    • Name and full (or relative) path of the file (up to 260 characters).
    • Full (or relative) path of directory (up to 260 characters). If this parameter corresponds to a directory name, this name may (or may not) end with "\".
      A UNC path can be used.
    <New date>: Optional character string (with quotes)
    • Modifying a date: new date associated with the file or directory (in YYYYMMDD format).
    • Reading a date: empty string ("").
    Linux The creation date of a file or directory cannot be modified.
    <Type of date>: Optional constant
    Indicates the date to handle:
    fAccessDate of last access to the file or directory.
    Java This constant is not available.
    fCreationCreation date of the file or directory.
    Java This constant is not available.
    fModify
    (Default value)
    Date of the last modification made to a file or directory.

    Linux The creation date of a file or directory cannot be modified.
    Java Only the files whose date is after 1st of January 1970 can be modified.
    Remarks

    Modifying the date and time associated with a file

    To modify the date and time associated with a file, you have the ability to use fDateTime.
    Remark: You also have the ability to use fDate and fTime successively. However, fDateTime is faster.

    Managing errors

    fDate generates an error in the following cases:
    • the specified file is opened or the file is locked by another application,
    • the specified file or directory does not exist,
    • the name of the specified file is invalid,
    • the year of one of the file dates is before 1980 (or 1970 in Java),
    • the format of <New date> is incorrect.
    • ...

    Operating mode in the different operating systems

    • The date associated with a file or a directory cannot be modified in the following systems: Windows 98, Windows ME.
    • Linux The creation date of a file or directory cannot be modified.
    • Java Only the files whose date is after 1st of January 1970 can be modified.
    WINDEVUser code (UMC)

    Operating mode in Windows Vista (and later)

    If this function does not operate properly in Windows Vista (and later), check whether the file or directory used is not in one of the system directories (Windows directory or "Program Files" directory).
    Indeed, in Windows Vista (and later), with the UAC mechanism (User Account Control) enabled, you must have the administrator privileges to handle and/or modify the files or directories in the system directories (Windows directory or "Program Files" directory).
    Programming tip: To handle and/or modify the files or directories without administrator privileges, you should:
    • avoid writing into the Windows directory or into the "Program Files" directory,
    • use the system directory corresponding to the application (returned by SysDir associated with the srCommonAppData constant).
    Component : wd250std.dll
    Minimum version required
    • Version 9
    This page is also available for…
    Comments
    Click [Add] to post a comment