Passing date and get in different format

I need to pass the date in “01/17/2019” and need to get back with the day’s info… In this case, i need to get the output like “Thu 01/17/2019”. I tried to do by Format value to get in the pattern… but it din work out. Is there any way to get the same? Ideas/solutions are welcome.

Thanks in advance.

Hello @Pradeep.Robot,

Have you tried the following pattern “ddd MM/dd/yyyy”? now.ToString(“ddd MM/dd/yyyy”)

Best Regards,
Susana

Hi @Susana

Thanks for your response, am aware of this formatting, The challenge here is its not today’s date. Whatever date it is passed, i need the value as mentioned… for eg… if i pass “05/15/2017” , the output should be “Mon 05/15/2017”.

Hello @Pradeep.Robot,

Maybe it’s a misunderstanding and I do not understand the issue. The today’s date was only for testing the format.

If you pass “05/15/2017” then you only have to convert this string to a dateTime variable and apply the previous format. Am I omitting something?

Hope this could help you.

Best Regards,
Susana

3 Likes

This is perfect !! :ok_hand:Thanks a lot @Susana. I kept my variable as generic instead of DateTime. It worked!

Oh! That mistake happens to me a lot :wink:! Glad to help you kk.virags

Best Regards
Susana

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.