Selecting Date format based on the string

Viewed 235

I have class which receives Date in string format from other class. It is now receiving two different formats

Format 1: YYYY_MM_DD

Format 2: EEE MMM dd HH:mm:ss z yyyy

now I want to write a method which receives this string and convert it into required format like this 'DDMMMYYYY '

2 Answers
Related