I have string var value 12/31/2018 00:00:00 now I want 1218 i.e MMYY
@Aditya10989
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
That’s because currentdate
isn’t a DateTime
, it’s a GenericValue
.
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.