DateTime Query

Hii everyone,

Below is the date and time retrieved from gmail in a string variable and displayed using a message box
image
This date is in string variable and is needed to be converted into a DateTime variable
For this reason I used:


But the error I am getting is below:

What is the command to be used so that I can convert the above datetime stored in string variable into a DateTime variable

Regards,
Supriya

Hi @supu123,
Kindly check this zip file,i hope it solves your issue.
time_Conversion.zip (48.1 KB)
Cheers.
Vashisht.

Hi @Vashisht

Thanks for the reply.I did the same but it is again the same error

Thanks and Regards,
Supriya

hi @supu123

Date.zip (11.0 KB)

Check the below XAML let me know if that worked

u can directly use DateVar.ToString(“dd/MM/yyyy HH:mm:ss”)

Hiii @ashley11

Same error continues
Thu, 06 Jun 2019 04:09:26 -0700(PDT) is this the issue for the timezone
How to work on this

Regards,
Supriya

use substring
Assign Newstr=StringVar.substring(5,20)

Then use parse exact method
DateTime.ParseExact(Newstr.ToString,“dd MMM yyyy hh:mm:ss”,Nothing).ToString(“dd/MM/yyyy HH:mm:ss”)

can you please send your xaml because im not getting any error

@supu123 try this

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.