How to convert json output date format

Uipath Forms return forms data in a jason object.
Im trying to use Date/Time from Forms…
I have disable the Time from DateTime activity of Forms and I have changed the date formate to (dd.MM.yyyy)
output of json object showing that result.

jsonoutput

The result is perfect except i have to split that so I do not take time.

When I read this Start and End date as
variable is string (strStartDate = jsonOutput(“StartDate”).ToString)

I get a result
stringvalue

And my question is why the jsonobject result and string result is different ?

jsonobject result is what i need so why its changing and how can i solv it.

that is the reason that i did formate change in DateTime jsonscript so that It wont give me wrong answer but still its changing when reading as string.

Thanks in advance

After getting as string you format like you want @mukeshsmart78

DateTime.ParseExact(strStartDate,"MM/dd/yyyy hh:mm:ss",System.Globalization.CultureInfo.InvariantCulture).Tostring("yyyy-MM-dd")

Regards
Sudharsan

Hello @mukeshsmart78 , It may be convert the date into Computer formated date.
Try this
strStartDate = jsonOutput(“StartDate”).ToString("yyyy-MM-dd")

or

DateTime.ParseExact(jsonOutput(“StartDate”).ToString,"MM/dd/yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).Tostring("yyyy-MM-dd")
  1. Convert JSON Date Format
    The first step is to convert the date string to a JavaScript Date object. You can do this using the following code
    var myDate new Date(dateString)
  2. Set the timezone
    You need to set the time zone before converting the date to a JavaScript Date object, otherwise the conversion won’t work correctly. To do this, use the following code
    myDate.setTimezone(“America/New_York”)
  3. Get the day of the week
    To get the day of the week, use the following code (this returns a number between 0-6
    myDate.getDay
  4. Get the month name
    To get the month name, use the following code. Note that months start at 0, not 1
    myDate.getMonth
  5. Get the year
    To get the year, use the following code, note that years start at 1900, not 1970