Datetime - input dialog

Hi Guys,

I have the following issue. I would like to resolve.

I have an input dialog in which i ask the user of the bot to input a date (needs to be dd/MM/yyyy), i saved the input as a string and would like to convert it to datetime dd/MMM/yyyy (as the program it needs to input it to requires it to be "21-Dec-2018 and not 21-12-2018). I have however tried to convert it to datetime. I do however get the error that the string is not recognized as a valid datetime.

How do i solve this?

Kr,

Matthew

Try to reformat your input date before converting.

image

Hey @Matthewvz

you can use like this :

DateTime.ParseExact(“yourinputdatestring”, “dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd-MMM-yyyy”)

For more information see attached sample :slight_smile:
Datetimesample.xaml (5.8 KB)

Let me know if you are having any prob :slight_smile:

Regards…!!
Aksh