Add year in date

Hi Friends, My Date is in this format 0119,now i want to add year into it i.e 0120 how to do that.

1 Like

Buddy @Rup_1

If year is in string format like
In_year = 0119

Then get the out_year in String Datatype like this with adding one year

Out_year = Datetime.Parseexact(in_year,“MMyy”,system.globalization.cultureinfo.invariantculture).Addyears(1).Tostring(“MMyy”)

@Rup_1

Try this expression:

Datetime.parseexact(“0119”,“MMyy”,system.globalization.cultureinfo.invariantculture).addyears(1).tostring(“MMyy”)

Note: Please don’t create multiple posts for same thing and wait some time you will get reply sure.

Hi Friends,
My Date is in this format 0119,now i want to add year into it i.e 0120
how to do that.

@Rup_1

Try this expression:

Datetime.parseexact(“0119”,“MMyy”,system.globalization.cultureinfo.invariantculture).addyears(1).tostring(“MMyy”)

1 Like