Murali P

Murali P

  • 1.5k
  • 207
  • 21.5k

Regarding Time Zone

Jul 26 2023 7:01 AM

hi team,

below is my query:

we have to show the records based on the current date..

Ex:  if the record date is greater than today date then show it as future other wise show as current or past.

problem :

if we save the record before 10am then the system is taking the server time which is 8hrs past to india time so showing as past instead of current

since the code is comparing the record date with datetime.today.  but as per the requirements the datetime.today has to be system time based of the region.

shall we use Datetime.UTCNOW.Date instead of the datetime.today to resolve this.

please share ur comments


Answers (4)