Convert date formet

I have string var value 12/31/2018 00:00:00 now I want 1218 i.e MMYY

First parse the string as a DateTime variable. This can be done using DateTime.Parse or DateTime.ParseExact. Then you can do myDateTimeVariable.ToString("MMyy") where myDateTimeVariable is whatever you called your variable.

1 Like

@DanielMitchell I try this but I got value mmyy as mentioned in attachment :stuck_out_tongue:

That’s because currentdate isn’t a DateTime, it’s a GenericValue.

1 Like

@DanielMitchell thank you very much its work

1 Like

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