Rupesh Kahane

Rupesh Kahane

  • 100
  • 19.1k
  • 4.2m

DateTime values is getting incorrect from XML to Database

Jul 25 2019 12:20 AM
I have model with some properties and I am passing xml file to my store procedure.
 
 below is the property in my model
  1. public DateTime LastUpdatedDateTime { getset; }  
 
While passing LastUpdatedDateTime values from C#, I am passing current date time
  1. LastUpdatedDateTime  = DateTime.Now;  
 In xml I am getting format like below 
 
  1. <MyModel>    
  2.     <Id>7</Id>       
  3.     <LastUpdatedDateTime >2019-07-25T10:29:52.9330116+05:30</LastUpdatedDateTime >    
  4.   </MyModel>   
 Now database value is not inserting as per curent datetime 
 
Can anyone please correct it. What exactly I am missing into this???
 
 
 

Answers (3)