I need to compare between userCurrentDate
to a list of options.
The options is a table in the database that contain time attribute (definition: TIMESTAMP(6) WITH TIME ZONE. in oracle). Each option have his time zone.
The userCurrentDate
(definition Date. in java) is a parameter that hold the user time and date with offset. The user can be from all over the world, so each user is in different time zone.
I need to compare between the user current date to the options date. So i need to get this 2 parameters in the same time zone.
How can i get this 2 parameters in the same time zone, in SQL?
I tried to get them in GMT, so i can get them in the same base, like this:
trunc(SYS_EXTRACT_UTC(o.time)) = trunc(sysdate)
But its not a good solution.
So, i need to get them in the same timezone. how can i get that in an SQL command (or other solution)?