Please best way to save client datetime on database and then get them, back ?

Monday, November 25, 2024 6:29:45 PM
  • Posted: Friday, December 7, 2018 9:45 PM
  • 44
Hi

please i have an site using grand node - now i need to save data with local time and date so i try

  exercise.ExerciseDate = _dateTimeHelper.ConvertToUtcTime(exercise.ExerciseDate, DateTimeKind.Local);


but i got error - then i try:

exercise.ExerciseDate = _dateTimeHelper.ConvertToUtcTime(exercise.ExerciseDate, DateTimeKind.Utc);


it works - but are that is UTC Time or local Client Time ?

so please can i know how to save client time as UTC and then get it back as client time ? or how can i save it to server direct with the client time  

thanks a lot .....
0
  • Posted: Saturday, December 8, 2018 3:11 PM
  • 55
I assume you're looking for a quick fix solution to implement. However, if you end up making the customizations yourself to compliment whatever it is you're trying to achieve, you might want to check out :

https://github.com/aspnet/Docs/issues/2024

https://docs.microsoft.com/en-us/dotnet/standard/base-types/how-to-display-localized-date-and-time-information-to-web-users
0
back to top
Filters