|
|
|
|
|
- Coherence between date and format
- PHP: Limitation
StringToDate (Function) In french: ChaîneVersDate Converts a date in character string format to a date in YYYYMMDD format. Remark: The transformation performed by function StringToDate consists in identifying the various components of the date in the initial character string, in order to construct the resultant character string.
Res = StringToDate("25/12/2001")
Res = StringToDate("25-12-2001")
StringToDate("")
Res = StringToDate("12-25-2001", "MM-JJ-AAAA")
Res = StringToDate("12-25-01", "MM-JJ-AA")
Res = StringToDate("12-25-2001", "MM-JJ-AA")
Res = StringToDate("12-25-01", "MM-JJ-AA")
Res = StringToDate("Sun, 25 Nov 2012 12:11:55 +0100", maskDateEmail)
Res = StringToDate("Sat, 25 Aug 2012 12:11:55 +0200", maskDateEmail)
Res = StringToDate("Sun, 24 Nov 2019 23:00:00 +0000", maskDateEmailUTC)
Res = StringToDate("2019-08-25T00:00:00.000+02:00", maskDateInternet)
Res = StringToDate("2019-08-24T22:00:00.000Z", maskDateInternetUTC)
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 occurs.
<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:- YYYY represents a 4-digit year.
- YY represents a 2-digit year. The years will be included between 1951 and 2050.
- M represents the month without a leading zero.
- MM represents a 2-digit month.
- MMM represents a 3-letter month (e.g., Jan). The case used depends on the language options of the project.
This notation is not case sensitive. - Mmm represents a 3-letter month with the first letter in uppercase (e.g., Jan).
This notation is not available. This notation is not case sensitive. - mmm represents a 3-letter month with the first letter in lowercase (e.g., jan)
This notation is not available. This notation is not case sensitive. - MMMM represents the month as a full name (e.g., January). The case used depends on the language options of the project.
This notation is not available. This notation is not case sensitive. - Mmmm represents the month as a full name with the first letter in uppercase (e.g., January)
This notation is not available. This notation is not case sensitive. - mmmm represents the month as a full name with the first letter in lowercase (e.g., january)
This notation is not available. This notation is not case sensitive. - D represents the day without a leading zero,
- DD represents a 2-digit day,
- DDD represents a 3-letter day (e.g., Mon). The case used depends on the language options of the project.
- Ddd represents a 3-letter day with the first letter in uppercase (e.g., Mon)
This notation is not available. - ddd represents a 3-letter day with the first letter in lowercase (e.g., mon)
This notation is not available. - DDDD represents the day as a full name (e.g., Monday). The case used depends on the language options of the project.
- Dddd represents the day as a full name with the first letter in uppercase (e.g., Monday)
This notation is not available. - dddd represents the day as a full name with the first letter in lowercase (e.g., monday)
This notation is not available. - M represents the first letter of the day (e.g., 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, an RSS feed, etc, ... The result is expressed in the local time zone. | maskDateEmailUTC | The format used corresponds to the date format of the RFC-5322 standard used to encrypt an email, an RSS feed, etc, ... The result is expressed in universal time (UTC). | maskDateInternet | The format used corresponds to the date format of the RFC-3339 standard used for international communications. The result is expressed in the local time zone. | maskDateInternetUTC | The format used corresponds to the date format of 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" tab, in the "Project" group, click "Description".
- Select the "Languages" tab then the "Date" tab.
- The format used corresponds to:
- the settings 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 date and 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> = "This monument was inaugurated on MMMM DD, YYYY". - If <Date> = "11/03/1970", the following format must be used:
<Format> = "MM/DD/YYYY".
PHP: Limitation The format with 9 decimal places is supported only from PHP 8 onwards. Example: StringToDate("2019-03-05T07:21:45.123456789+11:00", maskDateInternet)
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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|