DateTime$

Takes one parameter, Source

Description:

Enforces valid [DateTime] format, with error reporting if the format cannot be applied. This enforces the format rules only, it does not enforce a valid date or time value.

When called as a Top Query function, if the Top Query field Error does not already exist when this command is run, it will be created. If it does exist, it will be cleared before the specified Action is run. If an error occurs, a runtime error will be thrown, which may be caught with a Try/Catch block and the error string can be inspected or reported using the Top Query Error field.

When called using the Text or Format commands, if the Work Query field Error does not already exist when this option is run, it will be created. For any errors that occur per record, the error message for each record will be placed in the Error field.

 

Examples:

[New] Contact   = "2525-02-03 00:01:17Z"
'[New] Contact  = "2525+02-03 00:01:17Z"

Try
    Contact     = DateTime$ Contact
Catch
    HtmlErr     Error
End Try
HtmlAlert       ("Contact: " & Contact)

Try
    Contact     [DateTime]  'Does not return errors into Error field, acts same as Database Field Attribute
Catch
    HtmlErr     "Invalid Date Time format"
End Try

SetNew          "Contact", Contact
Text            "Contact", "DateTime", "Contact"
HtmlTable
'FailIfRecError

ResetFields     "Error"
Format          "Contact", "DateTime"
HtmlTable
FailIfRecError