ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Modifying the date and time associated with a file
  • Handling errors
  • Operating mode in the different operating systems
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns or modifies the different dates associated with a file or directory (date created, modified or accessed).
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 get more details on the error, use ErrorInfo.
<File or directory path>: Character string
  • 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.
AndroidAndroid Widget This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: In Android, an application has the rights to write into its setup directory or into one of its subdirectories, as well as onto the external memory (SDCard).
iPhone/iPadIOS WidgetMac Catalyst This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: On iPhone/iPad, an application has the rights to write into its setup directory or into one of its subdirectories.
<New date>: Optional character string
  • Modifying a date: new date associated with the file or directory (in YYYYMMDD format).
  • Reading a date: empty string ("").
iPhone/iPadIOS WidgetMac Catalyst 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.
AndroidAndroid Widget This constant is not available.
fCreationCreation date of the file or directory.
AndroidAndroid Widget This constant is not available.
fModify
(Default value)
Date of the last modification made to a file or directory.

iPhone/iPadIOS WidgetMac Catalyst The creation date of a file or directory cannot be modified.
AndroidAndroid Widget Only files with a date later than January 1, 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.

Handling errors

fDate throws 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.
  • iPhone/iPadIOS WidgetMac Catalyst The creation date of a file or directory cannot be modified.
  • AndroidAndroid Widget Only files with a date later than January 1, 1970 can be modified.
Component: wd290std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 08/22/2022

Send a report | Local help