1

Good Day to All,

I am working with a small code, where I cant get my right hand part correctly

Response.Cookie("MyCookie").Expires=DateTime.FromString("2011-10-1");

Above cookie codes were used in my company's old project, I am updating the code and could not find a property named FromString in DateTime. Can anybody tell me an alternative to get desired result ?

nandu.com
  • 343
  • 1
  • 5
  • 18

1 Answers1

1

To get a DateTime from a string, you would use DateTime.Parse

DateTime.Parse("2011-10-1")

Brandon
  • 68,708
  • 30
  • 194
  • 223