|
|
|
|
- Coherence between the date and the format
StringToDate (Function) In french: ChaîneVersDate Transforms a date in character string format into a date in YYYYMMDD format. Remark: The transformation performed by StringToDate consists in identifying, in the initial character string, the different components of the date to build the result string.
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("Sun, 25 Nov 2012 12:11:55 +0100", maskDateEmail) // Res = "20121125121155" Res = StringToDate("Sat, 25 Aug 2012 12:11:55 +0200", maskDateEmail) // Res = "20120825121155"
New in version 25
Res = StringToDate("Sun, 24 Nov 2019 23:00:00 +0000", maskDateEmailUTC) // Res = "20191124230000000" Res = StringToDate("2019-08-25T00:00:00.000+02:00", maskDateInternet) // Res = "20190825000000000" Res = StringToDate("2019-08-24T22:00:00.000Z", maskDateInternetUTC) // Res = "20190824220000000"
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.
This notation is not case sensitive. - Mmm represent the month in letters on 3 characters with the first letter forced in uppercase (for example: Jan.
This notation is not available. This notation is not case sensitive. - mmm represent the month in letters on 3 characters with the first letter in lowercase (for example: jan)
This notation is not available. 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.
This notation is not available. This notation is not case sensitive. - Mmmm represent the month in plain letters with the first letter in uppercase (for example: January)
This notation is not available. This notation is not case sensitive. - mmmm represent the month in plain letters with the first letter in lowercase (for example: january)
This notation is not available. 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.
- Ddd represent the day in letters on 3 characters with the first letter in uppercase (for example: Mon)
This notation is not available. - ddd represent the day in letters on 3 characters with the first letter in lowercase (for example: mon)
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.
- Dddd represent the day entirely spelled out with the first letter in uppercase (for example: Monday)
This notation is not available. - dddd represent the day entirely spelled out with the first letter in lowercase (for example: monday)
This notation is not available. - M represents the first letter of the day (for example: M,T,W,T,F,S,S)
This notation is not available.
- via the following constants:
| | maskDateEmail | The format used corresponds to the date format of the RFC-5322 standard used to encrypt an email, a RSS stream, ... The result is expressed in the local time zone. | New in version 25maskDateEmailUTC | The format used corresponds to the date format of the RFC-5322 standard used to encrypt an email, a RSS stream, ... The result is expressed in universal time (UTC). | New in version 25maskDateInternet | The format used corresponds to the RFC-3339 standard used for international communications. The result is expressed in the local time zone. | New in version 25maskDateInternetUTC | The format used corresponds to the RFC-3339 standard used for international communications. The result is expressed in universal time (UTC). Not available. | maskDateSystem | The format used corresponds to the format defined in the project description for the current language: - On the "Project" pane, in the "Project" group, click "Description".
- Select the "Languages" tab then the "Date" tab.
- The format used corresponds to:
- the parameters of the operating system,
- the specified parameters (with the defined days and months).
|
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:
|
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...
|
Business / UI classification : Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|