Date formats in workflows, typically come in a very long and "un-useful" format, which is: "YYYY-MM-DD HH:MM:SS" eg: 2019-11-05 10:46:54.0
This format is not very useful for business users and so changing it to be something more "readable" is a good idea in general.
Thanks to the help from our resident rock star...Mostafa Helmy, we have the following example that you can use today for your review esclation emails. The below could be applied to any dates in other areas of the product too, however review esclations is a widely used area and a good place to start.
The process is as follows, where we want to update the review "end date" value.You could apply this to the "start date" too, if you wanted.
select to_char(sysdate,'MM/DD/YYYY') as new_date from dual;
select to_char(sysdate,'DAY DD-MON-YY') as new_date from dual;
Image of the above SQL example
Always start in DEV, NOT prod
It must be before the "email" or what ever you want this better date format to be
Note: This SQL will create a new value called "new_end_date" which can then be added into your email.
Format | SQL |
---|---|
MM-DD-YYYY (08/21/2019) | select to_char(end_date,'MM/DD/YYYY') as new_end_date from pv_review where id='${jobUserData_acm.ReviewId}' |
DD-MM-YYYY (21/08/2019) | select to_char(end_date,'DD/MM/YYYY') as new_end_date from pv_review where id='${jobUserData_acm.ReviewId}' |
The new value wont show until you have done this!!
YEAR | Year, spelled out |
YYYY | 4-digit year |
YYY YY Y | Last 3, 2, or 1 digit(s) of year. |
IYY IY I | Last 3, 2, or 1 digit(s) of ISO year. |
IYYY | 4-digit year based on the ISO standard |
Q | Quarter of year (1, 2, 3, 4; JAN-MAR = 1). |
MM | Month (01-12; JAN = 01). |
MON | Abbreviated name of month. |
MONTH | Name of month, padded with blanks to length of 9 characters. |
RM | Roman numeral month (I-XII; JAN = I). |
WW | Week of year (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year. |
W | Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh. |
IW | Week of year (1-52 or 1-53) based on the ISO standard. |
D | Day of week (1-7). |
DAY | Name of day. |
DD | Day of month (1-31). |
DDD | Day of year (1-366). |
DY | Abbreviated name of day. |
J | Julian day; the number of days since January 1, 4712 BC. |
HH | Hour of day (1-12). |
HH12 | Hour of day (1-12). |
HH24 | Hour of day (0-23). |
MI | Minute (0-59). |
SS | Second (0-59). |
SSSSS | Seconds past midnight (0-86399). |
FF | Fractional seconds. |