accelQ provides a suite of commands to work with dates in action logic. All these commands are supported against a set of predefined date formats. Here are the standard formats supported by date commands directly:
- MM/dd/yyyy
- MM/dd/yy
- dd/MM/yyyy
- dd/MM/yy
- dd MMM yyyy
This article addresses how you can use date related logic with formats that are not directly supported by the standard date commands in ACCELQ.
Consider an example. Statement below adds 30 days to the current date and this command could return the new date in one of the 5 available formats. (Add to Current Date)
What if you need the date in dd MMM yyyy (04 Jul 2001) format?
Convert Date Time Format
This command helps you to convert a date/time from a given format to another format. Source and target date formats are pretty open ended by directly utilizing Java Simple Date Format.
When you need to work with an unsupported date format in your logic, use this command to convert back and forth between a standard format and a custom format. Use Java Simple Date Format symbols to create required patterns. (see below for examples)
Here is an example:
- (Add to Current Date) Get a future date (30 days from today) in mm/dd/yyyy and store in local parameter, future date
- (Convert Date Time Format) Convert this date to dd MMM yyyy (04 Jul 2001) format and store the result in local parameter, future date new format
Example date formats
You will find a complete listing of date format symbols on Java's documentation page
https://docs.oracle.com/javase/10/docs/api/java/text/SimpleDateFormat.html
Here is a table of symbols and some examples from Java documentation site:
Comments
0 comments
Please sign in to leave a comment.