Getting wrong date in DateTime.Parse function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sumansms
    New Member
    • May 2009
    • 1

    Getting wrong date in DateTime.Parse function

    Hi All,
    I am getting wrong date when I am using DateTime.Parse function. The following is the code..

    DateValue = DateTime.Parse( datarow[column1].ToString()).To String("MM/dd/yyyy");

    I am taking the data from a proc keeping it in a datarow. While displaying the value I am getting the date value one less then it is in the DB. e.g. 3/31/2010 values comes as 3/30/2010 (for some timezone). This is a code written by someone else so basically I need to know basically the reason. I searched in google and I think it might be avoided by using DateTime.ParseE xtract. But I need to know the reason why DateTime.Pase() doesnot return correct result. I need it urgently folks. So please help me get rid of my headache.

    Thanx in advance
Working...