How can i get/convert the date format as 31-Jan-2018?
I would like to input that date format into a field.
thank you.
How can i get/convert the date format as 31-Jan-2018?
I would like to input that date format into a field.
thank you.
Hi. Assuming the date string is in a format already like MM/dd/yy or MMM dd, yyyy, for example, then you can use the vb CDate() or Convert.ToDate(), then .ToString(format)
For example,
CDate("5/25/2018").ToString("dd-MMM-yyyy")
If your date string is of a different country than I’m used to where it’s reversed like “dd/MM/yyyy”, then you will need to use ParseExact I think. Refer to the Search option to find examples of that method.
Regards.
Hello @criskitz,
Use the below statement,
String currentDate;
currentDate = Now.Date.ToString(“dd-MMM-yyyy”);
Have a look at result,
Thanks,
Pankaj
Thank you all for the response! currentDate = Now.Date.ToString(“dd-MMM-yyyy”) is working.
Hi @criskitz,
You can try this one also.
currentDate = Date.Today.ToString(“dd-MMM-yyyy”)
Regards
Balamurugan