create date strict(value a, adjustable template b, default c, [locale d])
Group |
Parses a text a using template b and creates a timestamp from it.
An optional locale d can modify the parsing behaviour for month names and day names.
Description of Parameters
Parameter |
Description |
a |
The text to be interpreted. Note: Instead of a String (intended use) a Date or Timestamp object is also tolerated here (even if this makes the use of the function pointless), but then parameter b must remain empty. Note: If a String cannot be interpreted with the format template b or if a Date or Timestamp object has an Empty Flag, an error occurs and parameter c controls the further behaviour of the function. |
b |
Format template. Important note: If the string in a is shorter than the template in b, b is shortened to the length of a. Please note that in rare cases this can lead to loss of accuracy or invalid values and consequential errors. Special case W3CDTF: This format template does not consist of placeholders. Therefore, no shortening is done. The format does not contain month names or day names. Therefore, no locale is used (parameter d). |
c |
(optional) Behaviour of the function in case a text cannot be parsed as a date. Possible values see below. See also parameter a. Default: empty. |
d |
(optional) Locale. Default: System locale. Note: Use the three dots to select a value. Example: de_DE |
Possible Values for Parameter c
Value |
Behaviour of Function |
now |
The current date will be returned. |
empty |
The Empty Flag is set. Internally, the field also receives the current date. However, because of the Empty Flag, the value is not visible. See also function is empty(a). |
error |
The function terminates with an error. |
Other value |
Instead of the input value, this value will be interpreted instead. If this value cannot be parsed with b either, the function will terminate with an error. |
Examples
Current date of the example: 2011-10-20 15:33:23
Note: No date cannot be interpreted as a timestamp with any format template b and thus triggers an error. The further behaviour of the function is then controlled with parameter c.
Parameter a |
Parameter b |
Parameter c |
Parameter d |
Result |
Result of Function is empty(a) |
241205 |
ddMMyyHHmm |
error |
|
2005-12-24 00:00:00.0 |
false |
No date |
ddMMyyHHmm |
error |
|
The function terminates with an error. |
|
No date |
ddMMyyHHmm |
now |
|
2011-10-20 15:33:23.0 |
false |
No date |
ddMMyyHHmm |
empty |
|
(see description of empty for parameter c above) |
true |
No date |
ddMMyyHHmm |
231010 |
|
2010-10-23 00:00:00.0 |
false |
2412050820 |
ddMMyyHHmm |
error |
|
2005-12-24 08:20:00.0 |
false |
9-дек-2012 |
d-MMM-yyyy |
empty |
ru |
2012-12-09 00:00:00.0 |
false |
10.Dez 2012 |
dd.MMM yyyy |
empty |
de_DE |
2012-12-10 00:00:00.0 |
false |
1997-07-16T19:20:30Z (see format template W3CDTF) |
W3C |
now |
|
1997-07-16 21:20:30.0 |
false |