Difference between revisions of "AsDate"

From Keyfax Wiki
Jump to: navigation, search
(Example Three)
(Example One)
 
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.

Latest revision as of 10:32, 25 April 2019

Converts a value into a date using the format specified after the argument.

Example One

Asdatefunction1.png

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

Asdatefunction2.png

The fixed value to be converted.

Asdatefunction3.png

Asdatefunction4.png

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.

Asdatefunction5.png

Demonstration

The message applies the expression and displays it as seen below.

Asdatefunction7.png

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.

Asdatefunction8.png

Demonstration

Asdatefunction9.png

Asdatefunction10.png

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"

Asdatefunction11.png

  • 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

Asdatefunction12.png

Demonstration

Below the script has been run twice, once with an PM time and once with a AM time.

Asdatefunction13.png

Asdatefunction14.png

Asdatefunction15.png

Asdatefunction16.png