I have seen in manywhere people ask about several and in most of the cases people have suggested to go for UDF to get the desired date format. I hope this blog will be very useful for beginners. Here in this blog I will show few date formats conversions which are possible via standard DateTrans function.
How to get the “Month Name” from given Date by using DateTrans function.
Let’s say we have incoming date as 2009/02/13 and we want to get the desired output as 2009-FEB-13.
Here is the results from display Queue.
How to get the “Date” from give “Year and Days” by using DateTrans function.
Let’s say you have your source date in the from of year & days only i.e. yyddd and you want to convert it into yyyy-MM-dd or any other format.
The result after mapping are as shown below.
How to get time stamp with mili seconds.
How to get “Week Number” from given date Or how to get the “Date” from given Year and Week.
Just do exactly same as shown in the below picture.
Calculate Date in future or past.
For this, we have to use the UDF as shown below. You just need to map a constant value to this UDF to calculate the future or past date.
Mapping & Test Results: