We use a PLM software called "Aras Innovator" and need to store a date as a custom item property. The software uses Microsoft SQL Server to store its data and accessing properties on the database level is officially supported.
However, our issue is that the software only supports datetime, not date. And dates are stored in UTC - so when we store "2020-01-01" from a client in Central Europe, it becomes "2019-12-31 23:00" or so in the database (1 hour before midnight on the day before). And queries checking for ">= 2020-01-01" then consequently fail to find these rows.
The software manufacturer says:
There is no standard feature for storing only the month and day; a quick option may be to store it as a string instead and do programmatic validation on the inputted string if required.
Regarding direct SQL queries, all dates are stored in UTC for compatibility with multiple time zones. They are automatically converted when accessed via the standard API. When accessing direct with SQL, you can use the function ConvertToLocal described in the Aras Innovator 11.0 - Configuring Internationalization guide on the CD Image, section 5.3:
SELECT item_number, innovator.ConvertToLocal(created_on, 'Eastern Standard Time') AS CreatedOn FROM innovator.Document
ConvertFromLocal can be used for specifying dates you wish to query against rather than requiring those dates to be sent in UTC.
I'm not convinced that working with string would be a good solution. But not convinced that their "ConvertTo/FromLocal" functions would be a good solution either. Surely there must be some other way to handle this directly in SQL Server?