ORACLE Casting DATE to TIMESTAMP WITH TIME ZONE WITH OFFSET

后端 未结 3 1347
臣服心动
臣服心动 2021-02-04 08:23

I need to cast a DATE value in a query to a TIMESTAMP WITH TIME ZONE, but currently I\'m getting the TimeZone Region (\'Europe / Paris\') which is not valid to be used by EF.

3条回答
  •  暖寄归人
    2021-02-04 09:11

    You can cast the DATE to a TIMESTAMP, then use FROM_TZ to convert this timestamp to a timestamp with time zone:

    SQL> SELECT from_tz(CAST (SYSDATE AS TIMESTAMP), '+01:00') tz FROM dual;
    TZ
    -------------------------------------------------
    07/03/14 09:47:06,000000 +01:00
    

提交回复
热议问题