timezone

How to convert time zones in oracle?

一曲冷凌霜 提交于 2019-12-13 08:24:08
问题 I have a list from peoplesoft timezones which i need to convert using From_TZ method. The time zones will be in a format as EST,IST..etc. select FROM_TZ (CAST ( (:dt) AS TIMESTAMP), 'EST') AT TIME ZONE 'IST' from dual 回答1: IST does not work, because it is ambiguous, see this table: SELECT tzabbrev, TZ_OFFSET(tzname), tzname FROM V$TIMEZONE_NAMES tz WHERE tzabbrev IN ('EST', 'IST') ORDER BY 1,2,3; TZABBREV TZ_OFFSET(TZNAME) TZNAME EST +10:00 Australia/Brisbane EST +10:00 Australia/Lindeman EST

Using case when to insert values

旧城冷巷雨未停 提交于 2019-12-13 08:14:30
问题 Below shows a executable statement: Successful attempt: INSERT INTO Personnel_Assignment (DATE, testno, Hours) SELECT '21-OCT-2011', '12345', CASE WHEN Extract(day From(S.ENDTIME-S.STARTTIME) ) >= 1 THEN (Extract(Day From(S.ENDTIME-S.STARTTIME) ) * 24 + Extract(Hour From(S.ENDTIME-S.STARTTIME) ) ) WHEN S.endtime IS NULL THEN NULL ELSE Extract(Hour From(S.ENDTIME-S.STARTTIME) ) ) ||'hrs' End || Extract(Minute From(S.ENDTIME-S.STARTTIME) ) || 'Min' As Hours FROM Schedule S` Please note that the

Change a Date Object's Timezone in Java?

北慕城南 提交于 2019-12-13 08:02:52
问题 Turkey has two TimeZone GMT+2 and GMT+3. I want to change the GMT+2 dates into GMT+3, but I want to protect hours and minutes that in GMT+2 TimeZone. I want to take hours and minutes, and then set these values into GMT+3 TimeZone date. At result there must be no change in hours and minutes but the timeZone must be change only. At function toconvert date is must be GMT+2 format, but the return value must be GMT+3 format. How to do it clearly? public static Date convertTimezone(Date toConvert)

How to Set timezone in session of SQLite?

感情迁移 提交于 2019-12-13 07:44:56
问题 In MySql following query is used to set session set @@session.time_zone='+05:00'; But it is not working into SQLite. As on following link, It is not possible to set session in SQLite: http://stackoverflow.com/questions/2013542/how-to-set-timezone-for-sql We can select time according to zone as given in following query: select DateTime('now','-5.30 hours'); but it is not useful to set timezone in session. So Is there any way to set timezone in session of SQLite when executing any select/insert

PHP use CURRENT_TIMESTAMP from eastern time zone

五迷三道 提交于 2019-12-13 07:24:13
问题 I have a query that looks like: $query = "INSERT INTO `SmsServ`.`SmsReceived` ( `Id` , `Body` , `DateReceived` ) VALUES ( NULL , "Foo" , CURRENT_TIMESTAMP);" The problem with that query is that I will like to have eastern time as the time stamp. I have tried calling: date_default_timezone_set("America/New_York"); At the begining of my php script but that still gives an incorrect time stamp. 回答1: You did change the php time zone. So try to change the mysql time zone aswell(php and mysql time

CONVERT_TZ not working properly during winter/summer time change hour

偶尔善良 提交于 2019-12-13 06:31:32
问题 In Paris (timezone Europe/Paris) the timezone offset change on 2016-03-27 at 2:00am. Timezone is before at UTC+1 and after at UTC+2. Mysql function CONVERT_TZ not work if you give a time during the change : between 2016-03-27 02:00:01 and 2016-03-27 02:59:59 Example : SELECT CONVERT_TZ('2016-03-27 02:18:29', 'Europe/Paris', "UTC" ) === '2016-03-27 01:00:00' And funny : SELECT CONVERT_TZ('2016-03-27 01:00:00', 'UTC', "Europe/Paris" ) === '2016-03-27 03:00:00' I have to convert a mysql database

What do I put in date_default_timezone_set?

倖福魔咒の 提交于 2019-12-13 06:21:02
问题 I'm not from the US but I want to use date_default_timezone_set and set it to Englewood, Colorado. What do I use? I can't find any America/Englewood or America/Colorado in the documentation. Any help? 回答1: As google tells me that Colorado is in the 'Mountain Time Zone' use US/Mountain from the documentation 回答2: The correct TZDB zone name is America/Denver . US/Mountain is an alias that presently resolves to America/Denver , but it may not always be that way in the future. The US/* aliases

How to convert ( round ) epoch Time to nearest hour and day wrt IST (in Java)

非 Y 不嫁゛ 提交于 2019-12-13 06:01:29
问题 I have time in epoch format (as Java long variable). I want to convert it to nearest hour as well as day with respect to Indian Standard Time (IST). For example, if the epoch time is 1372618032000 (7/1/2013 12:17:12 AM IST), then i want to get 1372620600000 (7/1/2013 1:00:00 AM IST). Similarly for day rounding. I want to get 1372703400 (7/2/2013 12:00:00 AM IST). [Starting of the next day.] I have gone through some documentation of Java Date, Java Calendar, Apache DateUtils, and JodaTime. But

Storing a “fake” timestamp into a database

北慕城南 提交于 2019-12-13 05:54:15
问题 Here is the problem I am trying to solve: Read a string from database A, convert the string into a Date object, store the Date object into database B. EX) Database A: Read in date string "2015-03-08 02:00:00" from database A, convert into a Date object, store back into database B. The problem here occurs because 2:00 AM is the beginning of DST in U.S. Central time, so the Data object converts 2:00 AM straight into 3:00 AM, which means 3:00 AM gets stored into database B . Is there any way to

How can I convert float number to timezone?

人盡茶涼 提交于 2019-12-13 05:31:51
问题 How can I convert float number to timezone? Facebook breaks the timezone down using float. timezone float (min: -24) (max: 24) The person's current timezone offset from UTC user.timezone = auth.extra.raw_info.timezone captures a user's timezone location upon signing up via Facebook, for example timezone: -5.0 . I want to convert this though to timezone: "Eastern Time (US & Canada)" . A user could then adjust his timezone via <%= f.time_zone_select :timezone, ActiveSupport::TimeZone.us_zones %