PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • 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)
  • Creation date, modification date or access date
  • Equivalence
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:
  • PHP find out or modify the creation date of a file or directory.
  • Windows Mobile modify the date of a directory on a Pocket PC.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget 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.
WINDEVWEBDEV - Server codeReports and QueriesJavaPHPAjaxUser code (UMC)
// Retrieve the modification date of a file
ResDate = fDate("C:\MyDirectories\File.txt", "", fModify)
Windows Mobile
// Retrieve the creation date of a file
ResDate = fDate("\MyDirectories\File.txt", "", fCreation)
Syntax
<Result> = fDate(<Path of File or Directory> [, <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.
    PHP ErrorInfo cannot be used to identify the error.
<Path of File or Directory>: 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.
Versions 15 and later
AndroidAndroid Widget This parameter can correspond to a full path or to a relative path in relation 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 sub-directories, as well as onto the external memory (SDCard).
New in version 15
AndroidAndroid Widget This parameter can correspond to a full path or to a relative path in relation 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 sub-directories, as well as onto the external memory (SDCard).
AndroidAndroid Widget This parameter can correspond to a full path or to a relative path in relation 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 sub-directories, as well as onto the external memory (SDCard).
Windows Mobile This path must be a full path or a UNC path. It cannot be a relative path.
Versions 17 and later
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 sub-directories.
New in version 17
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 sub-directories.
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 sub-directories.
<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 ("").
LinuxiPhone/iPad 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 Java This constant is not available.
fCreationCreation date of the file or directory.
AndroidAndroid Widget JavaPHP This constant is not available.
fModify
(Default value)
Date of the last modification made to a file or directory.

LinuxiPhone/iPad The creation date of a file or directory cannot be modified.
AndroidAndroid Widget 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.
Note: 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.
  • LinuxiPhone/iPad The creation date of a file or directory cannot be modified.
  • AndroidAndroid Widget Java Only the files whose date is after 1st of January 1970 can be modified.
WINDEVWEBDEV - Server codeReports and QueriesUser 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 used is not found 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 found in the system directories (Windows directory or "Program Files" directory).
Programming tip: To handle and/or modify the files without having 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).
Windows Mobile

Creation date, modification date or access date

In most cases, the creation date, the modification date and the access date are identical.
Windows Mobile

Equivalence

The operating mode of fDate is equivalent to the operating mode of ceFileDate.
Only differences:
  • fDate handles a file or a directory found on the Pocket PC from a WINDEV Mobile application.
  • ceFileDate handles a file or a directory found on the Pocket PC from a standard WINDEV application.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Java wd230java.jar
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment