beantownace
Active member
- Joined
- Feb 15, 2019
- Messages
- 40
- Programming Experience
- 5-10
Hello gurus,
I got a question hoping someone dealt with this. I am comparing a database stored EST datetime to GMT based DateTime.Now where I ran into a problem realizing that the DB value is EST and when deployed via AWS seems to be GMT even on us-east-1. What is the best way to handle that compare as I need to make sure a datetime date only is today.
Current code is:
Thanks all for any suggestions best way to do this in C#. The SubmittedDate is EST and DateTime.Now is coming in as GMT when deployed to AWS.
I got a question hoping someone dealt with this. I am comparing a database stored EST datetime to GMT based DateTime.Now where I ran into a problem realizing that the DB value is EST and when deployed via AWS seems to be GMT even on us-east-1. What is the best way to handle that compare as I need to make sure a datetime date only is today.
Current code is:
DateTime Compare:
if (DateOnly.FromDateTime(db.SubmittedDate) != DateOnly.FromDateTime(DateTime.Now))
{
//do stuff
}
Thanks all for any suggestions best way to do this in C#. The SubmittedDate is EST and DateTime.Now is coming in as GMT when deployed to AWS.