Using TimeStamp with TimeZone in Entity Framework
923224Mar 12 2012 — edited Mar 23 2012Hi,
I have a table with a column defined as TIMESTAMP(6) WITH TIME ZONE
My Entity Framework entity was correctly defined in the designer as DateTimeOffset.
I need the Time Zone for the scenario of having a central server that writes to the DB and multiple users of different counties (that pass their DateTimeOffset) and I would like to both write the correct time (for all countries) and provide support using the local time of the user.
For example: if user X in England at 9 am had a problem I would like to contact him about 9am (and not my current time).
But when I use DateTimeOffset with an offset for another country the Time zone is switched back to my country (the time is the correct time).
Trying to debug the code I got to this line:
new OracleParameter(name, (object) ((DateTimeOffset) value).DateTime))
Where ODP.net is converting the value I pass to DateTime and later it is converted to the default DateTimeOffset (of my local computer).
Is there something I can do?