Determining PST time from SYSTIMESTAMP

Thanks to everyone who answered by previous question about SYSTIMESTAMP.
Here's a PL/SQL function I wrote to convert the current time to PST and return it as a DATE value. The idea is that it should work regardless of what the database's timezone is set to.
Any critiques are welcome - efficiency, style, whatever. In particular, is there a way to avoid the conversion to a VARCHAR2? Is there a system supplied function I am overlooking?
Thanks again!
CREATE OR REPLACE FUNCTION PST_SYSDATE RETURN DATE IS
  th NUMBER;
  tm NUMBER;
  now TIMESTAMP(6) WITH TIME ZONE;
  d  VARCHAR2(200);
BEGIN
  now := SYSTIMESTAMP;
  SELECT
    TO_CHAR(now, 'YYYY-MM-DD HH24:MI:SS'),
    EXTRACT(timezone_hour FROM now) TH,
    EXTRACT(timezone_minute FROM now) TM
  INTO d, th, tm
  FROM DUAL;
  RETURN TO_DATE(d, 'YYYY-MM-DD HH24:MI:SS') - ((th+tm/60+8)/24); 
END PST_SYSDATE;
/

You do not need a function for that. Use AT TIME ZONE TZ_OFFSET:
SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY HH24:MI:SS'
  2  /
Session altered.
SQL> SELECT  SYSTIMESTAMP EST,
  2          SYSTIMESTAMP AT TIME ZONE TZ_OFFSET('PST') PST,
  3          CAST(SYSTIMESTAMP AT TIME ZONE TZ_OFFSET('PST') AS DATE) PST_DATE
  4    FROM  DUAL
  5  /
EST                                      PST                                      PST_DATE
08-APR-09 03.25.39.034000 PM -04:00      08-APR-09 12.25.39.034000 PM -07:00      04/08/2009 12:25:39
SQL> SY.

Similar Messages

  • Determine propagation time from signals obtained with Gould Transition software

    Hi
    I'm trying to analyze signals from measurements of sound waves. I tried to do it with the Transition software, but this software is not sufficient because there are no averaging or filter options (furthermore you have to analyze graph after graph). Signals are saved in ASCII-code and what I'm looking for is a good and fast way to determine propagation time from the differences of the arriving of two waves. FFT would be great to.
    Thanks a lot
    Marco

    Any personal experiences would be greatly appreciated.

  • Determine audio file play time from size

    Hello!
    I have a mp3 file and i want to determine it's play time from it's length. Is this thing possible? Could anyone point me in the right direction?
    Thanks in advance!
    Cheers!
    Radu

    Thanks you both for your replies!
    I posted yesterday late in the evening and my brain didn't work quite well :)). After i've read your posts today, i realized that i will be using mplayer in slave mode to play the audio file, and a quick google search showed me that mplayer offers a way to retreive the play time of any audio/video file (in seconds). Tested it today and it works! So i guess my question has been answered.
    Thanks again
    Cheers!
    Radu

  • I can only print 1 copy at a time from indesign booklet on my xerox d95

    I can only print 1 copy at a time from indesign booklet on my xerox d95>

    I've never used Print Booklet or your printer, but some things are determined by the printer and printer software, rather than the program from which you are printing. You might want to see if Xerox's website has any info also.

  • How to determine the time of a RONA call

       What table do i need to lookup to determin the time that a RONA call came in for a particular agent  ?
    Hemal

    bornfree,
    The free Patharea/Pathlength Filters from Telegraphics is your friend (the former gives you both area and length, both in different units):
    Telegraphics - Free plugins for Photoshop & Illustrator...and other software

  • Function Module To Change TIME from GMT to CST

    Hello All,
    Can anyone tell me if there is any Function Module to convert the TIME from GMT to CST?
    Regards

    Hi Sunil,
    use the following code.
    DATA :
      timestamp like TZONREF-TSTAMPS,
      time      like sy-uzeit,
      date      like sy-datum.
    The following function module is used to convert the
    time and date into GMT timestamp
    CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
      EXPORTING
        i_datlo           = sy-datum
        i_timlo           = sy-uzeit
        I_TZONE           = 'INDIA'
    IMPORTING
       E_TIMESTAMP       = timestamp.
    The following function module is used to convert the
    above obtained timestamp to PST timezone date and time.
    CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
      EXPORTING
        i_timestamp       = timestamp
        I_TZONE           = 'CST'
    IMPORTING
        E_DATLO           = date
        E_TIMLO           = time.
    write :/ 'Date and Time at PST zone is ',date, time.
    Reward if helpful.
    Thanks,
    Naveen.

  • Planned Delivery Time from Material Master instead of PIRs

    Hi SAP Gurus,
    Do you know if there is a way to have MRP look at the Planned Delivery Time from the Material Master (MRP 2 tab) instead of the PIR?
    We would like to create global PIRs with a PDT of 1 and have the Material Master PDT set to a different number (example 5).  So when MRP runs it will read 5 instead of 1.
    Any additional information is appreciated.
    Thank you
    -nic

    Hi Nicholas,
    In Standard SAP will consider Planned delivery time maintained in Inforecord and than time maintained in Material master. Inforecord has higher priority than material master. When a requisition is manually created, the Planned Delivery date will always be taken from the material master.
    For MRP you can make setting OMDT for your plant or MRP group to determine planned delivery time.
    Deactive the flag 'Scheduling according to purchasing info record or agreement' in Customizing (Plant or MRP group). and test the same.
    Regards,
    R.Brahmankar

  • CCMS issue: "Determining warning messages from CCMS"

    Hi!
    We have a performance problem by accessing of solution in tcode DSWP.
    We retrieve the warning: "Determining warning messages from CCMS"
    In order to solve or analyse this problem I have the following questions:
    1) How collects CEN the data from satelite systems?
    1a)  how? -->  RFC, etc.
    1b) mode? --> Push, Pull, etc.
    2) How the data will be transfered from CEN to tcode DSWP?
    Any helpful information will be appreciated.
    regards
    Thom

    Hi Thom,
    Have you already installed CCMS agents, the will speed up communication? That's definitely required in your situation with many systems connected to SolMan.
    See [http://service.sap.com/monitoring|http://service.sap.com/monitoring]
    You can also check CPU, Memory, as recommended by Afi, but I expect that this will not be the bottleneck.
    Response times depend on the number of connect systems, number of activated monitoring objects (MTE nodes), number of server, instances.
    If you are not satisfied with performance, I would recommend to open a customer message on component SV-SMG-OP or SV-SMG-MON-SYS.
    Best regards,
    Ruediger

  • Tcode DSWP, Determining warning messages from CCMS

    We use SAP Solution Manager 4.0, SPS 13 for System Monitoring of almost 100 systems.
    We configured SOLMAN as CEN system and activated the CCMSPING with –push option.
    For almost the 2/3 of the systems we configured SAPCCM4X agents.
    Our current problem is a performance issue in tcode DSWP. When we try to enter into one of the solutions there (by pressing on it) we get the following warning:
    Determining warning messages from CCMS
    It tooks a while and then it is possible to access  the desired solution.
    My important question is of course:
    How can this issue be solved?
    Is there some techniques to analyse and change the problem
    How can I check whether all the agents work in push mode and that we do not use standard CCMS methods that can cause the RFC load? 
    Thank you very much for any helpful information
    Regards
    Thom

    Hi Thom,
    Have you already installed CCMS agents, the will speed up communication? That's definitely required in your situation with many systems connected to SolMan.
    See [http://service.sap.com/monitoring|http://service.sap.com/monitoring]
    You can also check CPU, Memory, as recommended by Afi, but I expect that this will not be the bottleneck.
    Response times depend on the number of connect systems, number of activated monitoring objects (MTE nodes), number of server, instances.
    If you are not satisfied with performance, I would recommend to open a customer message on component SV-SMG-OP or SV-SMG-MON-SYS.
    Best regards,
    Ruediger

  • Determine load. time

    Hello Gurus,
    The Determine load. time is  C Default from shipping point in define shipping point - config.
    But I want to know from where the days are defauted as I could not see this in define shipping point itself.
    Please tell me where the load time is mentioned in config to get defaulted.
    thank you
    murali

    Hi Murali krishna,
    Pls find the path where we are going to define the load time below:
    SPRO>Enterprise structure>Definition>Logistics Execution>Define,Copy,delete,check shipping point-->Define shipping point.
    In the screen Determine times tab you can find the field Determine load time with options as (blank,A,B and C).
    If you want to change then select the second option as Copy, delete, check shipping point.Select your shipping point and edit the one you want.
    Regards,
    Mohan.

  • TS3920 iPad 1 w/ iOS 5 on Barcelona time zone location when Automatically Set Date/Time is turned on.  How do I get all of my devices back to PST time?

    After returning from an extended trip in Spain, my iPad 1 with iOS 5 retains the Barcelona location when "Automatically Set Date/Time".  Most of my Apple devices are affected, how do I get all of my devices back to PST time?  Thanks!

    Turn off Automatically Set Date/Time and set your time zone.

  • Time From field is not getting displayed in correct format in Activities

    Hello Experts ,
    We are facing one problem in UI , when we search for Activities in Web UI . In the field "Time From" we are not getting the time in correct format , ie is instead of  getting time as say 13::38 we are getting time as 13::3 , but when we place cursor on it the field it shows correct format say 13::38.
    Can any one suggest how to display in correct format ?
    Regards
    Vinayak

    Hi,
    Its an SAP Product error.
    Please check note 1151821 ,if you facing the greyed button in time.Also the other note 1136402 needs to be applied for time display issue
    - Bobby

  • View more than one sheet at a time from the same file?

    I'm trying to view two different sheets at the same time from one file. This was possible in excel by opening a "new" window. Does anyone know how to do this in numbers?
    Thanks for the help,

    Skigilboa wrote:
    I'm trying to view two different sheets at the same time from one file. This was possible in excel by opening a "new" window. Does anyone know how to do this in numbers?
    You know what: Happily, _*Numbers is definitively not a clone of Excel*_ !
    It's not forced to duplicate every features of this program !
    We may see every tables of a given sheet
    but we can't see tables of two sheets simultaneously.
    This feature is very important because it's linked to
    the one which allow us to have different orientation for different sheets.
    Yvan KOENIG (VALLAURIS, France) dimanche 13 septembre 2009 15:04:06

  • How to send report output to  two  detinations at a time from command line?

    Hi ,
    how to send my report to two detinations at a time from command line i.e FILE and Mail ?
    i created batchfile in that i mentioned one line for file(DESTYPE=FILE) perpose and another line for mail perpose(DESTYPE=Mail).i don't want to mention to lines.
    i want to send my report out put two destinations at a time insted of running two times.
    thx in advance.....
    raghu

    hello,
    did you try to use distribution for that ? check out the reports distribution facilities available in 6i.
    regards,
    the oracle reports team

  • Is there a way to delete multiple pictures at the same time from the iphone4s?

    Is there a way to deleter multiple pictures at the same time, from my iphone4s? I know how to delete one at a time. Thanks

    Open your Photos App > Camera Roll > At the top right corner you will see a rectangle with a right arrow, select that. Now you can select as many photos as you want and you can hit the red Delete button on the bottom right.

Maybe you are looking for

  • Re open the closed Posting Periods - Very Urgent

    Dear Experts, We have an urgent problem to solve.The company code currently we are configuring uses fiscal year (oct - Sept) and the other company codes in our client site uses (jan -Dec). So by mistake we closed posting periods using MMPV upto 2007

  • Hp officejet pro L7700 printer

    Hi, my printer (HP Officejet Pro L7700 Series) is connected via wireless router fro my laptop (windows 7). when i try printing it doe not print but it says the printer is offline. i've tried the troubleshooting through windows but it says the printer

  • Can I put a MacBook processor and hard drive in a PowerMacG5?

    I have a late 2008 MacBook that is showing its age and wear. The battery is worn out and the keys and mouse sometimes stick. I also have a PowerMac G5 which has an older operating system, but great working keyboard, mouse, and monitor. Can I put the

  • Equations in Word 2007 turns into horizontal lines

    This is something that has come up a lot lately. Documents written in Word 2007 which contains graphics such as equations get messed up when converting the documents to PDF. Instead of the equations, we only get horizontal lines. I've found several t

  • Printing same document to different printers results in differint number of pages

    Hello - when I print a form, created in a custom application, to an HP 1160, it prints on 4 pages.  When I use the same computer and application to print the form to an HP 1320, it prints on 3 pages.  The form was designed to print on 3 pages, and wh