cancel
Showing results for 
Search instead for 
Did you mean: 

How to populate the Day from the input date value

Former Member
0 Kudos

Hi,

I have a requirement , i need to populate the day ( Sunday or Monday  or whatever exact string ) based on input date value.

I had tried with date transformation, which is not producing string value of required Day from the standard date functions.

Can anyone guide me how to get this value without UDF. If UDF is mandatory then plz guide me how to write the simple java code to fetch this value.

Regards

Jain

Accepted Solutions (1)

Accepted Solutions (1)

RaghuVamseedhar
Active Contributor
0 Kudos

Jain,

Use "EEEE" or "E".

iaki_vila
Active Contributor
0 Kudos

Hi Raghu,

Great trick!, DateTrans function in more powerful that we sometimes imagine.

Regards.

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Raghu,

Nice trick with out writing udf for the requirement.

Answers (2)

Answers (2)

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Jain,

Just to add here is that the mapping functions will take the system timezone as the default.

If you want any other specific timezone calendar, then udf is needed to set the same and give the output.

iaki_vila
Active Contributor
0 Kudos

Hi Jain,

If you import in yor UDF the java.util.calendar, you can do it easily like this thread shows:

http://stackoverflow.com/questions/18333099/how-to-find-which-day-of-the-week-it-is-java

Regards.