Datetime check for CST and EST time zones

  • Thread starter Thread starter Vamshi K J
  • Start date Start date
V

Vamshi K J

Guest
Hello All,


In the database table, i have a column with time value in HH:mm format (24 hr time format i.e. something like 14:30 )

I have a windows service which will execute daily at 14:30 time to process the data.


I have tried to convert 14:30 time to todays datetime format

var shiftDateTime = DateTime.ParseExact(shiftModel[0].EndTime, "HH:mm", null, System.Globalization.DateTimeStyles.None);


shiftDateTime will be 8/28/2019 2:30:00 PM



Need help on the condition check for both CST and EST time zones.

The windows service should process the data when currentdatetime is equal to shiftDateTime (OR) when currentdatetime is between shiftDateTime and shiftDateTime + 30 minutes.

shiftDateTime + 30 minutes - adding 30 mins so that windows service will able process the data which is not ready by exact shiftDateTime .



Thanks in advance


Vamshi Janagama

Continue reading...
 
Back
Top