Difference between revisions of "AsDate"
(→Example Three) |
(→Example One) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 20: | Line 20: | ||
[[File:asdatefunction5.png]] | [[File:asdatefunction5.png]] | ||
+ | |||
+ | ===Demonstration=== | ||
The message applies the expression and displays it as seen below. | The message applies the expression and displays it as seen below. | ||
Line 30: | Line 32: | ||
[[File:asdatefunction8.png]] | [[File:asdatefunction8.png]] | ||
+ | |||
+ | ===Demonstration=== | ||
[[File:asdatefunction9.png]] | [[File:asdatefunction9.png]] | ||
Line 45: | Line 49: | ||
*The result is written into '''Script.Info01''' and displayed in the message '''Expressions.EXPDATE08''' | *The result is written into '''Script.Info01''' and displayed in the message '''Expressions.EXPDATE08''' | ||
+ | ===Setup=== | ||
+ | |||
+ | [[File:asdatefunction12.png]] | ||
+ | |||
+ | ===Demonstration=== | ||
Below the script has been run twice, once with an PM time and once with a AM time. | Below the script has been run twice, once with an PM time and once with a AM time. | ||
Line 55: | Line 64: | ||
[[File:asdatefunction16.png]] | [[File:asdatefunction16.png]] | ||
− | |||
− | |||
− | |||
− |
Latest revision as of 10:32, 25 April 2019
Converts a value into a date using the format specified after the argument.
Contents
Example One
Convert a fixed value. Databox CompanyData.Expressions.Date holds the value 15-10-2016 and using Examples.Date.AsDate in the message Expressions.EXPDATE it is converted into the format "ddd dd MMM yyyy"
Setup
The fixed value to be converted.
This is the expression to convert it to a different format. Using the correct formats shown on the Date Expressions page, you can convert this date into almost limitless formats.
Demonstration
The message applies the expression and displays it as seen below.
Example Two
Convert a user entered date. This example follows the same format as the first but using a date entered by the user rather than a fixed value.
Demonstration
Example Three
Convert 24 hour time to 12 hour time. User enters time in the 24 hour format "HH:mm" and it is converted into and displayed as 12 hour time "hh:mm tt"
- The user enters the time in question Time01
- This is written into Examples.Date and then evaluated against Examples.Date.AsDate 24H->12H
- The result is written into Script.Info01 and displayed in the message Expressions.EXPDATE08
Setup
Demonstration
Below the script has been run twice, once with an PM time and once with a AM time.