gokul1904
(Glory 01)
February 6, 2023, 11:43am
1
Hi I want to add 30 days to a certain date ,
Currently I am doing as below -
Datetime.ParseExact((in_Config(“BNY_Last_Updated_Date”).ToString),“MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture).AddDays(”+"+“in_Config(“Password Validity Days”).ToString”)
but its giving error.Please help here
Hi, store the json string in int variable using: CInt(in_Config(“Password Validity Days”).ToString) and then use inside AddDays().
Hi @gokul1904 ,
Could you try with the below :
Datetime.ParseExact(in_Config("BNY_Last_Updated_Date").ToString,"MM/dd/yyyy",System.Globalization.CultureInfo.InvariantCulture).AddDays(Cint(in_Config("Password Validity Days").ToString))
If the above still results in an error, Share the error message as well
1 Like
Shanmathi
(Shanmathi Sadhasivam)
February 6, 2023, 11:57am
4
Hi @gokul1904
Datetime.ParseExact(in_Config("BNY_Last_Updated_Date").ToString, "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture).AddDays(Cint(in_Config("Password Validity Days").ToString)).Tostring("dd-MM-yyyy")
Gokul001
(Gokul Balaji)
February 6, 2023, 12:01pm
5
Hi @gokul1904
After AddDays
You need to covert the string into Int
How about this expression?
Datetime.ParseExact(in_Config("BNY_Last_Updated_Date").ToString,"MM/dd/yyyy",System.Globalization.CultureInfo.InvariantCulture).AddDays(Cint(in_Config("Password Validity Days").ToString)).Tostring("dd-MM-yyyy")
Regards
Gokul
system
(system)
Closed
February 9, 2023, 12:01pm
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.