Is this essential for you too,
@RickV ?
As an alternative, could you store the datetimes in gmt/utc (or ticks) and allow the DateTime & DateUtils methods to convert to local datetime where ever the app is being used?
I am using a mysql database server. I have decided to use a field with a long data type to store the ticks unless there is a better data type to use for storage and searching.
I have discovered that mysql has infact a perfect time zone query that returns the result that I have been looking for. I only discovered its potential this arvo.
You will need to populate the time zone tables in the mysql database and use the following queries (I wish I knew this 6 weeks ago haha)
SELECT CONVERT_TZ('2012-06-07 12:00:00', 'GMT', 'America/New_York');
or
SELECT CONVERT_TZ('2023-05-05 17:00:00', '+10:00', '-5:00');
SELECT CONVERT_TZ('date time , from, to);
the result is a date time string value
If you dont have data in any of the timezone tables, use this link to get the data, open it with navicat or something and run the query, it will populate the database. It is about 5 MB
Use this if you want to pull the zones for a country
select * from time_zone_name where name like '%australia%';