DateTime conversion issue

Hii everyone,


is the issue
I want convert the string to datetime variable

Regards,
Supriya

@supu123

First try to print value from Excel and check the format once. And also show me your expression once.

Hii @Lakshaman

Regards,
Supriya

Hi @supu123

Use a strvar and again startdatetime.toString(“MM/dd/yyyy”)

Thanks
Ashwin.S

Hi everyone,

Same error is displayed.

Regards,
Supriya

Hi @

In the screenshot you have given start datetime in double quotes and use it as normal startdatetime

Thanks
Ashwin.S

Hii

StartTime is a string
StartDateTime is a DateTime variable

I need to convert startTime to StartDateTime

Regards,
Supriya

@supu123

Try this:

DateTime.ParseExact(startTime,“dd/M/yyyy HH:mm:ss tt”,CultureInfo.InvariantCulture)

Where startTime is of type String and input is coming from Excel file. Create one DataTime variable and store above expression result into it using Assign Activity.

Hi @supu123

Use starttime=startdatetime.ToString(“MM/dd/yyyy”)

Thanks
Ashwin.S

Cultureinfo not defined

Regards,
Supriya

1 Like

Create a variable as culture info and declare the type as culture

@supu123

Write like this and see.

System.Globalization.CultureInfo.InvariantCulture

@supu123 I dont know this is the proper way or not but you can review it
Hope it will help you…:slight_smile:
BlankProcess2.zip (17.0 KB)