PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Coherence between the date and the format
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
Transforms a date in character string format into a date in YYYYMMDD format.
Note: The transformation performed by StringToDate consists in identifying in the initial character string the different components of the data to build the result character string.
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 16 and later
StringToDate proposes some new formats used to precisely configure the format of the days and the format of the months (presence of an uppercase character (or not) at the beginning of the day or at the beginning of the month.
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 16
StringToDate proposes some new formats used to precisely configure the format of the days and the format of the months (presence of an uppercase character (or not) at the beginning of the day or at the beginning of the month.
Universal Windows 10 App This function is now available for the Windows Phone applications.
StringToDate proposes some new formats used to precisely configure the format of the days and the format of the months (presence of an uppercase character (or not) at the beginning of the day or at the beginning of the month.
Universal Windows 10 App This function is now available for the Windows Phone 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.
Example
Res = StringToDate("25/12/2001")  // Res = "20011225"
Res = StringToDate("25-12-2001")  // Res = "20011225"
StringToDate("")                  // Returns ""
Res = StringToDate("12-25-2001", "MM-DD-YYYY")  // Res = "20011225"
Res = StringToDate("12-25-01", "MM-DD-YY")      // Res = "20011225"
Res = StringToDate("12-25-2001", "MM-DD-YY")    // Res = ""
Res = StringToDate("12-25-01", "MM-DD-YY")      // Res = "20011225"
Res = StringToDate("12-25-01", "MM-DD-YY")      // Res = "20011225"
Versions 16 and later
Res = StringToDate("Sun, 25 Nov 2012 12:11:55 +0100", maskEmailDate) // Res = "20121125121155"
Res = StringToDate("Sat, 25 Aug 2012 12:11:55 +0200", maskEmailDate) // Res = "20120825121155"
New in version 16
Res = StringToDate("Sun, 25 Nov 2012 12:11:55 +0100", maskEmailDate) // Res = "20121125121155"
Res = StringToDate("Sat, 25 Aug 2012 12:11:55 +0200", maskEmailDate) // Res = "20120825121155"
Res = StringToDate("Sun, 25 Nov 2012 12:11:55 +0100", maskEmailDate) // Res = "20121125121155"
Res = StringToDate("Sat, 25 Aug 2012 12:11:55 +0200", maskEmailDate) // Res = "20120825121155"

Syntax
<Result> = StringToDate(<Date> [, <Format>])
<Result>: Character string or Date variable
  • Date in YYYYMMDD format (YYYY corresponds to the year, MM to the month and DD to the day).
  • Empty string ("") if a problem occurred.
<Date>: Character string
Date in the format specified in <Format>.
<Format>: Optional character string or optional constant
Format of the date to convert:
  • in string format:
    In this string, the characters:
    • YYYY represent the year on 4 digits.
    • YY represent the year on 2 digits. The years will be included between 1951 and 2050.
    • M represents the month (no zero is displayed in front of the month number).
    • MM represent the month (the month must be on 2 digits).
    • MMM represent the month spelled out on 3 characters (for example: jan). The case used depends on the linguistic options of project.
      WEBDEV - Browser code This notation is not available in browser code. WEBDEV - Browser code This notation is not case sensitive.
    • Versions 16 and later
      Mmm represent the month in letters on 3 characters with the first letter forced in uppercase (for example: Jan)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      New in version 16
      Mmm represent the month in letters on 3 characters with the first letter forced in uppercase (for example: Jan)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      Mmm represent the month in letters on 3 characters with the first letter forced in uppercase (for example: Jan)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      WEBDEV - Browser code This notation is not case sensitive.
    • Versions 16 and later
      mmm represent the month in letters on 3 characters with the first letter in lowercase (for example: jan)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      New in version 16
      mmm represent the month in letters on 3 characters with the first letter in lowercase (for example: jan)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      mmm represent the month in letters on 3 characters with the first letter in lowercase (for example: jan)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      WEBDEV - Browser code This notation is not case sensitive.
    • MMMM represent the month entirely spelled out (for example: january). The case used depends on the linguistic options of project.
      WEBDEV - Browser code This notation is not available in browser code. AndroidAndroid Widget JavaPHP This notation is not available.
      WEBDEV - Browser code This notation is not case sensitive.
    • Versions 16 and later
      Mmmm represent the month in plain letters with the first letter in uppercase (for example: January)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      WEBDEV - Browser code This notation is not case sensitive.
      New in version 16
      Mmmm represent the month in plain letters with the first letter in uppercase (for example: January)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      WEBDEV - Browser code This notation is not case sensitive.
      Mmmm represent the month in plain letters with the first letter in uppercase (for example: January)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      WEBDEV - Browser code This notation is not case sensitive.
    • Versions 16 and later
      mmmm represent the month in plain letters with the first letter in lowercase (for example: january)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      WEBDEV - Browser code This notation is not case sensitive.
      New in version 16
      mmmm represent the month in plain letters with the first letter in lowercase (for example: january)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      WEBDEV - Browser code This notation is not case sensitive.
      mmmm represent the month in plain letters with the first letter in lowercase (for example: january)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      WEBDEV - Browser code This notation is not case sensitive.
    • D represents the day (no zero is displayed in front of the day number),
    • DD represent the day on 2 digits,
    • DDD represent the day spelled out on 3 characters (for example: mon). The case used depends on the linguistic options of project.
      WEBDEV - Browser code This notation is not available in browser code.
    • Versions 16 and later
      Ddd represent the day in letters on 3 characters with the first letter in uppercase (for example: Mon)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      New in version 16
      Ddd represent the day in letters on 3 characters with the first letter in uppercase (for example: Mon)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      Ddd represent the day in letters on 3 characters with the first letter in uppercase (for example: Mon)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
    • Versions 16 and later
      ddd represent the day in letters on 3 characters with the first letter in lowercase (for example: mon)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      New in version 16
      ddd represent the day in letters on 3 characters with the first letter in lowercase (for example: mon)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      ddd represent the day in letters on 3 characters with the first letter in lowercase (for example: mon)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
    • DDDD represent the day entirely spelled out (for example: monday). The case used depends on the linguistic options of project.
      WEBDEV - Browser code This notation is not available in browser code.
    • Versions 16 and later
      Dddd represent the day entirely spelled out with the first letter in uppercase (for example: Monday)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      New in version 16
      Dddd represent the day entirely spelled out with the first letter in uppercase (for example: Monday)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      Dddd represent the day entirely spelled out with the first letter in uppercase (for example: Monday)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
    • Versions 16 and later
      dddd represent the day entirely spelled out with the first letter in lowercase (for example: monday)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      New in version 16
      dddd represent the day entirely spelled out with the first letter in lowercase (for example: monday)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      dddd represent the day entirely spelled out with the first letter in lowercase (for example: monday)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
    • Versions 16 and later
      M represents the first letter of the day (for example: M,T,W,T,F,S,S)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      New in version 16
      M represents the first letter of the day (for example: M,T,W,T,F,S,S)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
      M represents the first letter of the day (for example: M,T,W,T,F,S,S)
      WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This notation is not available. AndroidAndroid Widget JavaPHP This notation is not available.
  • via the following constants:
    maskSystemDateThe format used corresponds to the format defined in the project description for the current language ("Project .. Project description", "Languages" tab).
    WEBDEV - Browser code This constant is not available.
    The format used corresponds to the format defined in the project description for the current language:
    1. On the "Project" pane, in the "Project" group, click "Description".
    2. Select the "Languages" tab then the "Date" tab.
    3. The format used corresponds to:
    • the parameters of the operating system,
    • the specified parameters (with the defined days and months).
    Versions 16 and later
    maskEmailDate
    New in version 16
    maskEmailDate
    maskEmailDate
    The format used corresponds to the date format of the RFC-5322 standard used for encrypting emails, RSS streams, ...
    WEBDEV - Browser code Not available.
If this parameter is not specified, the format used by default is DD/MM/YYYY (DD + a specific character + MM + a specific character + YYYY).
Remarks

Coherence between the date and the format

You must check whether the <Date> and the specified <Format> are coherent. Therefore:
  • If <Date> = "The inauguration date of this monument was 10/02 of year 1995", the following format must be used:
    <Format> = "The inauguration date of this monument was DD/MM of year YYYY".
  • If <Date> = "The 03/11/1970", the following format must be used:
    <Format> = "The DD/MM/YYYY".
Related Examples:
The EXIF functions Unit examples (WINDEV): The EXIF functions
[ + ] Using the ImageXXX functions.
These functions are used to access the EXIF information of an image.
The EXIF information is included in the JPEG or TIFF images.
It can be for example the snapshot date, the orientation of the device when taking the photo, the make and model of the camera, a miniature of the image...
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
WEBDEV - Browser code WDJS.DLL
Java wd230java.jar
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Exemplo StringtoDate
Exemplo StringtoDate

//Transforma Texto em Data // Transforms Text Data // Transforme données texte
EDT_Date=StringToDate("12-25-2001","MM-DD-YYYY")
//Frances
EDT_Date=ChaîneVersDate("12-25-2001","MM-DD-YYYY")

//Blog com video e exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/07/curso-windev-datas-013-stringtodate.html
https://www.youtube.com/watch?v=OQTm5a5dWbI


De matos AMARILDO
Jul. 26 2016