locked
DateTime.Now RRS feed

  • Question

  • User895691971 posted

    Hi, 

    I am not able to understand why time stamp used in one block of code doesnotmatch the other, even the variable used is same.

    DateTime

    In this picture you can see the comment was made just after a few minutes, but the TimeStamp is saved in a different manner, I was told about Culture, but thats not being used anywhere. 

    Everywhere, if the comment is on post then the timestamp is like this but on photos the timestamp is just like the one in the post.

    The variable is same used: 

    var time = DateTime.Now;

    In the post and photo.

    Sunday, September 1, 2013 2:28 PM

Answers

  • User895691971 posted

    Hehehe just found one error, the data type was set to nvarchar in the comment So it was being saved like that.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 1, 2013 2:30 PM

All replies

  • User895691971 posted

    Hehehe just found one error, the data type was set to nvarchar in the comment So it was being saved like that.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 1, 2013 2:30 PM
  • User-1426144113 posted

    Hi,

    I would like to know why the type of nvarchar will effect the data. Could you provide the detail reason?

    Thanks

    Monday, September 2, 2013 1:24 AM
  • User895691971 posted

    Hi, actually the code 

    DateTime.Now;

    gets the current time of the computer, and after you submit, it is saved based on the datatype of the Column. It was saved as that because it was allowing 'Sep' in other column it was DateTime so it had to convert the 'Sep' to '9'.

    Tuesday, September 3, 2013 3:50 AM
  • User895691971 posted

    Hi, actually the code 

    DateTime.Now;

    gets the current time of the computer, and after you submit, it is saved based on the datatype of the Column. It was saved as that because it was allowing 'Sep' in other column it was DateTime so it had to convert the 'Sep' to '9'.

    Tuesday, September 3, 2013 3:50 AM