![]() |
Here we will change data type from datetime type to string
|
Description:
Actually when we need date time value in specific format like (dd/mm/yyyy)
or in other format, while we are using datetime as a string
variable.
In this case it becomes a little bit typical to change string variable
value to a specific format. So here we need to change our string variable value
to a specific datetime format after that change it to a format you want to
change
Steps:
C#:
DateTime dtStrExpiryDateTo
= DateTime.ParseExact(strExpiryDateTo, "mm/dd/yyyy", null);
strExpiryDateFrom =
dtStrExpiryDateTo.ToString("mm/dd/yyyy");

👍👍
ReplyDelete