Customising SYSDATE using time-zone offset

Situation:
A database instance is configured with multiple schemas with each holding data for a company. A set of Oracle Forms and Reports programs has been developed to run against each of these schemas.
However, there are few overseas companies phyiscally located in different time zone with respect to the database location.
Is there a way to "customise" sysdate to generate "adjusted" date/time value using the time zone offset "without changing the programs" (in Forms, Reports and dbms)? Most of the programs use sysdate to populate date-specific fields.
Please advise.
Thanks

Sysdate is sysdate-- it can't be changed on a session-by-session basis. You could write your own sysdate-like function, but that would require code changes. If you are making code changes, and you're on 9i, I would suggest using a TIMESTAMP WITH TIMEZONE data type.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC

Similar Messages

  • How get current time zone offset ?

    Hi,
    I am facing to a problem related getting time zone offset.
    Below code is used for my application :
    NSDate* sourceDate = [NSDate date];
    NSTimeZone* destinationTimeZone = [NSTimeZone systemTimeZone];
    timeZoneOffset = [destinationTimeZone secondsFromGMTForDate:sourceDate] / 3600;
    But sometimes seems that above code is getting work wrong. For example :
    Knoxville, TN : time zone offset should be -5. But my code resulted it as -4.
    http://www.timeanddate.com/worldclock/city.html?n=843
    This web is related my issue. Here is :
    Standard time zone: UTC/GMT -5 hours
    Daylight saving time: +1 hour
    Current time zone offset: UTC/GMT -4 hours
    Actually I don't know how get to "Daylight saving time:".
    Can you correct this issue for me ?
    Please advice.
    Thanks.

    Hi Raiden -
    RaidenMAC wrote:
    Knoxville, TN : time zone offset should be -5. But my code resulted it as -4.
    I think your code is giving you the correct offset for Knoxville on today's date. The offset for Eastern Standard Time (EST) is -5, but Knoxville is currently on Eastern Daylight Time (EDT), which is one hour later than EST. (-5) + 1 => (-4), which is what your code computed.
    Note that [secondsFromGMTForDate:|http://developer.apple.com/library/ios/documentation/Co coa/Reference/Foundation/Classes/NSTimeZoneClass/Reference/Reference.html#//appleref/doc/uid/20000190-CACDIAIC] is correcting for daylight savings time. That's why you need to pass the date to that method. If you pass a "summer" date, the return offset will be one hour more than it will be for a "winter" date (usually early November to mid March). For example, try moving the date forward 60 days like this:
    NSDate *sourceDate = [NSDate dateWithTimeIntervalSinceNow:3600 * 24 * 60];
    NSTimeZone* destinationTimeZone = [NSTimeZone systemTimeZone];
    int timeZoneOffset = [destinationTimeZone secondsFromGMTForDate:sourceDate] / 3600;
    NSLog(@"sourceDate=%@ timeZoneOffset=%d", sourceDate, timeZoneOffset);
    The above should give you the offset for Knoxville on Dec. 7, 2010, which is a winter date.
    Actually I don't know how get to "Daylight saving time:".
    You can test a NSTimeZone object with [isDaylightSavingTimeForDate:|http://developer.apple.com/library/ios/documentat ion/Cocoa/Reference/Foundation/Classes/NSTimeZoneClass/Reference/Reference.html#//appleref/doc/uid/20000190-CHDCJGHE], but you don't need that information when you obtain the offset with secondsFromGMTForDate:.
    - Ray

  • Retrieve System Time Zone Offset?

    Hi, I'm doing some GPS emulation and need to retrieve the system Time Zone Offset in (Hour and Minute). For example if Mountain time zone offset hour = -7 and Minute = 00. Is this information possible to get in Labview?
    Thanks.

    Hello QRP,
    Yes, it can be done, but this way is not very elegant. It will get the GMT offset that your PC has as its current setting.
    Use Format Date/TIme String with a format string of "%z". The output is the offset as a STRING formatted HH:MMS
    Break the string apart with Scan From String to get the individual elements, or by using "%t" as the format, get the offset in seconds.
    Rod.
    EDIT: There shouldn't be a smiley in the time format above, It's "HH : MM : SS" but ignore the spaces!

  • Time Zone Offset - Date Format question

    I'm wondering if any one knows how to display the time zone offset of a date in the following format "[+-]HH:mm." More so... I need the date/time in the ISO 8601 format "yyyy-MM-dd'T'HH:mm:ss[+-]HH:mm", where the last [+-]HH:mm is the hour representation of the offset. Here's some sample code...
    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    Calendar rightnow= Calendar.getInstance();
    // So if system date/time is February 14, 2002 at 1:15:00 PM EST, this would produce "2002-02-14T13:15:00"
    System.out.println("Current Datetime" + sdf1.format rightnow.getTime());
    How can I get the timezone offset appended to my output in a [+-]HH:mm format. So, the above date needs to look like "2002-02-14T13:15:00-05:00". I can get the offset in milliseconds by doing the following:
    int offset1 = rightnow.get(rightnow.ZONE_OFFSET) + rightnow.get(rightnow.DST_OFFSET);
    But how can you get this representation into the [+-]HH:mm format?
    thanks in advance,
    stophman

    Try something like this:import java.text.* ;
    import java.util.* ;
    static public String formatISO8601(Calendar cal) {
         * create ISO 8601 formatter for Calendar objects
        MessageFormat iso8601 = new MessageFormat("{0,time}{1,number,+00;-00}:{2,number,00}") ;
        // need to shove a date formatter that is cognizant of the
        // calendar's time zone into the message formatter
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss") ;
        df.setTimeZone(cal.getTimeZone()) ;
        iso8601.setFormat(0, df) ;
         * calculate the time zone offset from UTC in hours and minutes at the current time
        long zoneOff = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET) ;
        zoneOff /= 60000L ;  // in minutes
        int zoneHrs = (int) (zoneOff / 60L) ;
        int zoneMins = (int) (zoneOff % 60L) ;
        if (zoneMins < 0) zoneMins = -zoneMins ;
        return (iso8601.format(new Object[] {
                                    cal.getTime(),
                                    new Integer(zoneHrs),
                                    new Integer(zoneMins)
    }

  • How to use time zone settings with calendar events ??

    After looking through the questions on time zones and synchronization, I still cannot get my Palm Centro to operate the way I think it should.
    I have a Verizon Centro, am using Windows XP with Outlook, and synching via the Hotsync manager 7.02 over a USB cable.  I am not using Palm Desktop.
    I am expecting events to shift time in the calendar when I change the time zone, but they do not.
    I am preparing for a trip.  I enter several test events into MS Outlook placing the events to occur in a different time zone into my calendar at the time the event would occur in my home time zone (NY).   For example, a meeting from 9-10 AM in Los Angeles is put in my MS outlook calendar as 12-1 PM on the day of the meeting.  Then I sync, with the time zone of my Centro and Outlook set for New York.  The Centro is set to update Date, Time, Zone automatically from the network in New York. The meeting event appears as 12-1 PM on the correct day.
    Then I turn off the Centro phone (ie disconnect from the Verizon network), change the time update to "Nothing" -- ie entirely manual, change the time zone to Los Angeles and set  the time to the correct time in Los Angeles.   I expect the meeting to shift to 9-10 AM in my Centro calendar, but it does not !!!!!  I try other combinations -- Leave the time update on Date and Time automatic, and change the time zone to Los Angeles, etc.  I think I tried all the combinations.  Throughout, I leave the Centro phone off of the Verizon network.  I cannot get the meeting to change its time in the new time zone.
    What is the trick ??? What did I miss ??
    You might ask why I am trying this with the phone turned off -- that is because I am really going much farther than LA, and into a GSM network where I will simply use the Centro as a PDA.
    Any advice appreciated.
    Post relates to: Centro (Verizon)
    This question was solved.
    View Solution.

    thepoeta --
    Thanks for the response.
    Indeed my preference was not set "new events use time zones".
    Meanwhile, I had loaded all the applointments from Outlook, about 20 of them,
    figuring I would just move them manually en route.
    I will play with the time zone preference, but,
    is there any way to identify the existing appointments in the
    Palm as belonging to a different time zone, just using the Palm Centro ?
    Thanks,
    Neal

  • How to remove time zone offset when we use a number as a relative time variable?

    Hi everyone!
    I've a small doubt in using a number as a relative time. If I change the display properties of a numeric to relative time, it takes default value "5:30 AM", may be because I'd set time zone to Indian time during installation ( India is 5:30 hours ahead of Greenwhich). I want it to take default value "12:00 AM'. Please help me how I do it?
    ( I can also subtract 5:30 hours and get the same. But I want that to have "12:00 AM" by default......?!)
    Thank you all..!
    pavamana

    pavamana_pk wrote:
    Hi everyone!
    I've a small doubt in using a number as a relative time. If I change the display properties of a numeric to relative time, it takes default value "5:30 AM"
    As Ravens already stated, you are using ABSOLUTE time.  Relative time can only be set to display hours, minutes, and/or seconds.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Time zone offset

    Hi all,
    Im trying to extract the number of offset hours (from GMT) for a given datetime out of a 'timestamp with time zone' but with no success.
    I can't use the function TZ_OFFSET because of DST, the offset is changing acording to DST, and im getting a datetime from all year periods.
    select to_timestamp_tz('10/29/2006 01:01:00 gmt', 'mm/dd/yyyy hh24:mi:ss tzr') from dual
    returns : 10/29/2006 1:01:00.000000000 AM +00:00
    select to_char(to_timestamp_tz('10/29/2006 01:01:00 gmt', 'mm/dd/yyyy hh24:mi:ss tzr')) from dual
    returns : 29-OCT-06 01.01.00.000000000 AM GMT
    the hours offset has turned into the timezone string.....
    Any Ideas?
    Thanx,
    Anna

    I am trying to do the same thing.
    I just want to get the hours from GMT of a given time zone, in standard time always, not daylight savings time.
    Is there a way to do this?

  • Set Date & Time Using Time Zone

    Hello everyone,
    Thanks in advance for any ideas you may have.
    I would like to be able to change the time using the time zones - i.e. when I open date & time and select the time zone I’m in, I want the time to change to reflect where I am. Currently, when I change the time zone, there is no change to the time.
    Do you have any suggestions how to get the computer to recognize the change in time zone?
    Thanks.

    I should add that if I select the box to set date and time automatically, the computer displays a time completely unrelated to the time zone I've selected - this time does not change depending on the time zone selected.

  • Find time offset from GMT using time zone

    Hi,
    Is there any way i can query the time offset from GMT using the timezone of a place.
    E.g. If I am in India
    My TZNAME is 'Asia/Calcutta' and TZABBREV='IST'
    How can i get the time offset from GMT for this timezone?
    In this case I want +5:30 as the result.
    Regards
    Ravi

    SQL> select dbtimezone
      2  from dual;
    DBTIME
    +01:00
    SQL> Regards,
    Gerd

  • How can I use time zone support without effecting iCal

    Is the a way to have the time automatically sync with my location without changing anything, like appointment times, in iCal?

    Is the a way to have the time automatically sync with my location without changing anything, like appointment times, in iCal?

  • Databases for Multi Time Zone

    We got two different SQL Server which are running SQL Server 2008 R2 and soon we are upgrading to one SQL Server 2012. Both are running in different time zone
    I been given a task that whether is it possible to publish databases on One Server with different Time Zone( just to reduce the cost).
    we got  1000+ SP's which uses Getdate() and GET date UTC function. 
    My Question is that, is it possible to publish databases on a single server with multi Time zone and if yes then how do i manage those. 
    Thanks

    Hi,
    Agree with the previous comments. The workaround is to use SWITCHOFFSET() function to calculate the time based on a time zone offset.
    The following example uses SWITCHOFFSET to display a different time zone offset than the value stored in the database.
    CREATE TABLE dbo.test
        ColDatetimeoffset datetimeoffset
    GO
    INSERT INTO dbo.test
    VALUES ('1998-09-20 7:45:50.71345 -5:00');
    GO
    SELECT SWITCHOFFSET (ColDatetimeoffset, '-08:00')
    FROM dbo.test;
    GO
    --Returns: 1998-09-20 04:45:50.7134500 -08:00
    SELECT ColDatetimeoffset
    FROM dbo.test;
    --Returns: 1998-09-20 07:45:50.7134500 -05:00
    See more details here:
    SWITCHOFFSET (Transact-SQL)
    http://msdn.microsoft.com/en-us/library/bb677244.aspx
    Using time zone data in SQL Server 2008
    http://blogs.msdn.com/b/sqlprogrammability/archive/2008/03/18/using-time-zone-data-in-sql-server-2008.aspx
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Browser Time Zone Setting

    We're using Apex 4.x and I need to capture the Browser Time Zone (TZ) into an application level item. Can anyone please suggest the approach.
    Initial thoughts are to capture the TZ using JavaScript and use it inside the Page 101 login procedure. But, I'd appreciate any tips on how this TZ can be passed into an application level item and stored for further usage within my application.
    Thanks,
    VS Kumar

    Jari - Thanks for your great tip. I was able to utilize this feature and assigned to apex application variable the timezone offset using GET_SESSION_TIMEZONE. I have a minor issue since I'm setting in the apex developer menu path - 'Shared Components ->Edit Globalization Attributes ->Automatic Time Zone=Yes'
    When I run the application there is a brief 5 seconds *'Set Time Zone'* message that pops and then I see the login. Do you know how this message can be not visible, but still be able to set the session time zone offset using the above setting (Meaning, the problem is fixed using the above setting, but the message that appears before the login screen appears 'Set Time Zone' is a bit inconvenient.
    Can you please advice if this message can be made NOT to display, but continue to use the 'Yes' for 'Automatic Time Zone' in the Globalization Attributes?
    Thanks,
    SK

  • Session Time ZONE

    Hi ALL,
    Can you please suggest on this, how to do this:
    If I run queries in my machine:
    select sessiontimezone from dual
    I get “+05:30”
    And formula
    select
    to_number (substr(sessiontimezone,1,1) || '1') * (to_number(substr(sessiontimezone,2,2))+ to_number(substr(sessiontimezone,5,2)) /60) /24
    from dual
    Gives “0.229166666666667”
    But when we are running same queries on Amit Rathore’s machine it is giving us
    select sessiontimezone from dual
    “Asia/Calcutta”
    And error in formula
    select
    to_number (substr(sessiontimezone,1,1) || '1') * (to_number(substr(sessiontimezone,2,2))+ to_number(substr(sessiontimezone,5,2)) /60) /24
    from dual
    “Invalid Number”
    Could you please suggest how we can change sessiontimezone to return hours and minutes (“+05:30”) in other machine?
    Regards
    Girish Sharma

    Assuming you have 11g.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions162.htm#SQLRF06105
    SESSIONTIMEZONE returns the time zone of the current session. The return type is a time zone offset (a character type in the format '[+|]TZH:TZM') or a time zone region name, depending on how the ?user specified the session time zone value in the most recent ALTER SESSION statement."
    The default client session time zone is an offset even if the client operating system uses a named time zone. If you want the default session time zone to use a named time zone, then set the ORA_SDTZ variable in the client environment to an Oracle time zone region name. Refer to Oracle Database Globalization Support Guide for more information on this variable.Setting the Session Time Zone
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10729/ch4datetime.htm#NLSPG263
    {code}% setenv ORA_SDTZ 'OS_TZ'
    % setenv ORA_SDTZ 'DB_TZ'
    % setenv ORA_SDTZ 'Europe/London'
    % setenv ORA_SDTZ '-05:00'
    ALTER SESSION SET TIME_ZONE=local;
    ALTER SESSION SET TIME_ZONE=dbtimezone;
    ALTER SESSION SET TIME_ZONE='Asia/Hong_Kong';
    ALTER SESSION SET TIME_ZONE='+10:00';{code}

  • Why is iCal Time Zone Support hidden?

    Last week my wife sent me an iCal appointment for 2pm but I received it as 11am. On checking her iPhone she found the same time, 11am. We had both been overseas recently. On our return we had reset our time zones on our iPhone's and laptops to Auto so no problem there. Obviously we were very puzzled.
    I then checked the Apple support page and found a lot of people had the same problem with Mountain Lion although I'm running Mavericks.
    What I did discover was that in iCal > Preferences> Advanced is hidden a button called Time Zone Support.
    Why put it there? And why is it off by default?
    We turned it on on my Mac Book and hers then switched it off then on again on our iPhones and low and behold the appointment times changed to 2pm on all our devices.
    I don't understand why changing time and date settings or having them on Auto shouldn't adjust all native apps and hiding the setting in advanced preferences just seems ridiculous.
    Maybe that's just me?

    I'm not sure how putting something in the user Preferences for an app hides it, but...
    And why is it off by default?
    I got into an argument with someone about using time zones in Calendar. He only wanted the times to show up as local times regardless of which time zone was selected and what time zone had created the event. I think he actuall missed some appointments when travelling overseas. His assistant had set up the appointments, and when he looked at them before he left, they were listed as late in the day because he was looking at his current time zone.
    So, I guess that is why it is off by default.

  • Time Zone support

    I understand the basic gist of time zone support as it is pretty straight forward, but I'm constantly finding myself confused when I use time zone support when I travel.  For instance, I use EDT and sometimes put events in my calendar that I know I'll have while I'm traveling.  If I put an event in my calendar for 2:00 pm because that is when the event is supposed to start, but the event is taking place in California, the event shows up in my calendar at 11:00 am and I get all confused as to when my events are actually supposed to start.
    Is the best policy to figure out what the adjusted time is supposed to be and make the adjustment beforehand, or is it best to turn off time zone support?  It gets really confusing when trying to add events to your calendar when the events take place in different time zones.
    Any thoughts on this subject would be greatly appreciated
    Mac

    Simple answer is that the events should not be moving if the setting has stuck, so it's probably a preference file that has been corrupted.
    Do you see the time zone at the top right of the iCal window?
    If it's there even though you have unchecked the option in preferences, it might be worth going into preferences and rechecking, quitting preferences, going back in and unchecking.
    If that fails to get rid of the zone in the window (or it wasn't there in the first place), you probably need to trash the preferences file for iCal:
    Quit iCal.
    Look for this file ~/Library/Preferences/com.apple.iCal.plist [That's in the Preferences folder of the Library folder of your home folder in case you don't understand the notation.] Drag it to the desktop - or somewhere convenient (so that you know where it is and can put it back if iCal gets screwed-up).
    Restart iCal.
    This should start iCal in the default mode - which is with Time Zone support off. You will notice that the position and size of windows, default view (month, week, day), etc have also been reset - so you will need to arrange them to your liking and check that the preferences that you need are set correctly.
    You should now be able to change time zone without everything moving. If it works, you can trash the file you moved to the desktop.
    If this doesn't fix your problem, you can at least get back to where you started by:
    Quitting iCal.
    Dragging the original .plist back over the new one.
    Restarting iCal.
    * Make sure you back-up your data before doing anything. However, I just tried this with my own iCal and it all worked 'as advertised' *

Maybe you are looking for

  • Home button on ipod touch not working!!! how can i fix it? no warranty!!!!

    my ipod touch home button is not working everything on the ipod works fine but the home button. i have to turn off the ipod and then turn it back on as a substitute fix. has anyone else had this problem? if you have any ideas or know how to fix it pl

  • Help with project...

    I have aproject to do in my cs class. I seriously do not know what to do here: "For this project you will write a program that will aid in the cracking of a substitution cipher. Basically, it is a form of frequency analysis. Your program will read in

  • The creation of the export DataSource failed 0FIGL_O06, 0FIGL_O02

    Hello Expert, I have an issue with the export data source creation, This is the detail, Thank you very much in advance for your kind help, The creation of the export DataSource failed Message no. RSBM035 Diagnosis The creation of the DataSource &v1&

  • Error when installing Demo (OEHR)

    Question removed. Edited by: Wolfram Dorner on May 20, 2009 4:43 PM

  • Firefox not using all CPU's

    This may be a windows 8 issue, but I can't get my CPU over 20% usage. I am a big tab user, and the system is only slightly faster than my old 2 core system. I had upgraded to a new windows 7 system, and it was zippy, but the hard drive crashed. I swa