Is java.sql.Timestamp timezone specific?

后端 未结 6 1479
忘掉有多难
忘掉有多难 2020-11-22 04:51

I have to store UTC dateTime in DB.
I have converted the dateTime given in specific timezone to UTC. for that I followed the below code.
My input dateTime is \"20121

6条回答
  •  遥遥无期
    2020-11-22 05:14

    It is specific from your driver. You need to supply a parameter in your Java program to tell it the time zone you want to use.

    java -Duser.timezone="America/New_York" GetCurrentDateTimeZone
    

    Further this:

    to_char(new_time(sched_start_time, 'CURRENT_TIMEZONE', 'NEW_TIMEZONE'), 'MM/DD/YY HH:MI AM')
    

    May also be of value in handling the conversion properly. Taken from here

提交回复
热议问题