typescriptfan1
Joined 6 years ago
Karma
46
Submissions
13
Member since
Jan 15
Joined 6 years ago
* If you're reading UTC dates from the backend and displaying them in local time, new Date(year + 1900, month, day, hour, minute, second) works great.
* It's also easy to calculate repeating intervals in local time by using that constructor with getYear(), getMonth(), etc.
* Send it back to the server with .toISOString(). Add a .replace('Z', '') on that so .NET binds a DateTime with the right Kind.
This is somewhat reminiscent of the abuse of higher level languages and the mindset computers are so powerful there's no need to think too hard. However, the consequences are no longer limited to a slow and buggy program but many slow and buggy programs and a large AWS bill too!