Validating date and time with the Date/Time Formatter builderAdded by IBM on June 28, 2011 | Version 1 (Original)
|The Date/Time Formatter builder can be used to validate dates and times.
The Date/Time Formatter builder can be used to validate dates and times.
- Open the Date/Time Formatter builder, and follow these steps:
- If the variable to validate is a DateTime or dateTime data type, do nothing.
The Date/Time Formatter will try to validate the date according to several formats already included in the builder.
If you scroll down the Date, Time, and DateTime fields and do not see the format you wish to use, then you can enter this format in the Requested Parsers fields. The builder will attempt all formats in these fields from top to bottom first, before it attempts to parse the formats that are built into IBM® WebSphere® Portlet Factory Designer.
dd MM yyyy hh:mm
- If the variable you wish to validate is not a DateTime or dateTime data type, but should be treated like one of these data types, such as a Sstring, then enter this variable in the Fields: field.
This will tell the builder to attempt to convert/cast the data type that the variable is declared to be into a valid dateTime or DateTime data type. Then the builder will attempt to parse the variable to see if it matches a format in the builder or one in the Requested Parsers field.
- For each variable you can also decide how you would like the builder to convert this variable. In the "Fields" Table, enter DateTime, Date, or Time
- Place a Data Page Formatter builder at the bottom of the builder call list.
Parent topic: Creating pages and forms