Convert Data time stamp to Local Time

Hello,
I want to convert this input to local time EST.
Input:12/8/2006 10:23:00.000000000 PM -06:00
o/p: EST.Local Time

Is the input a string? A timestamp? If so, which flavor of timestamp? Something else?
Normally, you'd want to use a TIMESTAMP WITH LOCAL TIME ZONE data type for this sort of requirement, since it automatically converts data to the client's time zone. Assuming the input is a string and that the client's time zone is set to EST
  1  select cast(to_timestamp_tz( '12/8/2006 10:23:00.000000000 -06:00',
  2                               'MM/DD/YYYY HH24:MI:SS.FF TZH:TZM' )
  3                AS TIMESTAMP WITH LOCAL TIME ZONE)
  4*   from dual
SCOTT @ nx102 JCAVE9420> /
CAST(TO_TIMESTAMP_TZ('12/8/200610:23:00.000000000-06:00','MM/DD/YYYYHH24:MI
08-DEC-06 11.23.00.000000 AM
Elapsed: 00:00:00.01
SCOTT @ nx102 JCAVE9420> Justin

Similar Messages

  • Converting UTC time stamp to local time (CET)

    Is there a smooth way to convert a time stamp from UTC time into the local time (e.g. CET)?
    CONVERT TIME STAMP.... Just converts the timestamp from local time zone to UTC, is there another comand to perform the opposite conversion?
    TIA!
    /Armin

    Hi Armin
    The statement does not only convert from local time zone to UTC you can specifiy any timezone:
    CONVERT TIME STAMP time_stamp TIME ZONE tz
            INTO [DATE dat] [TIME tim]
            [DAYLIGHT SAVING TIME dst].
    The following statement can also be used to convert from date time to timestamp.
    CONVERT DATE dat [TIME tim [DAYLIGHT SAVING TIME dst]]
            INTO TIME STAMP time_stamp TIME ZONE tz.
    Regards
    Faaiez

  • HELP - How to Convert Date in GMT to Local time in Applet

    Hi All
    Is there a way to convert a date from GMT format into a local time say IST in my Java applet, this GMT date is coming from a postgresql database.
    Thanks in advance
    Swaraj

    Try this with your customization:
    java.text.SimpleDateFormat format0 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    java.text.SimpleDateFormat format1 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    java.util.Calendar cal0 = Calendar.getInstance(new SimpleTimeZone(0, "GMT"));
    java.util.Calendar cal1 = Calendar.getInstance(new SimpleTimeZone((int)(5.5*60*60*1000), "IST"));
    format0.setCalendar(cal0);
    format1.setCalendar(cal1);
    java.util.Date date = format0.parse("2003-01-25 00:15:30");
    java.lang.String formatted = format1.format(date);
    System.out.println(formatted);

  • Converting UNIX time stamp to local time using T- SQL

    Hi All,
    I am getting DateTime in UTC time (UTC time (Coordinated Universal Time or Greenwich Mean Time))  using (datediff(ss, '1/1/1970', current_timestamp)) . I want to Convert this in my Local DateTime (CST DateTime). How to achieve this in simple way in T-SQL.
    thanks,
    Venkat

    Imports System.Data.SqlTypes
    Imports System
    Imports System.Data
    Imports System.Data.SqlClient
    Imports Microsoft.SqlServer.Server
    Partial Public Class UserDefinedFunctions
        'Microsoft.SqlServer.Server.SqlFunction(IsDeterministic=false)
        <SqlFunction()> _
        Public Shared Function displayLocalTime(dt As SqlDateTime) As SqlDateTime
            If (dt.IsNull) Then
                Return dt
            End If
            Return TimeZone.CurrentTimeZone.ToLocalTime(dt.Value)
        End Function
    End Class
    Apply it to SQL Server and use in SELECT statement
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Time stamp and local time stamp

    Dear sirs...
    i am a little confused about the time stamp datatype and how to handle it in my applications. i want to display the time for every user in its time zone. so the fields in the database are timestamp with local time zone. is this correct?
    i want it to be such that if one stores the time in USA time , the other can display that same data in UK time.
    best regards

    repost

  • Convert system time into User local time.

    Hi,
    How to convert System time into User Local time.
    Are there any FMs available.
    Regards,
    Kiran

    hi,
    There is just one simple funda behind the Date and time logic in SAP.
    -> It is absolutely useless to store Date and time directly in DB. Why ?
    Because 00:00 a.m in London could mean 05:30 in India !! So If I (in India) store a Date 1st Feb 2008 , 10:00 a.m .. This time for a person in London could be invalid.. because he is behind your time zone..
    So the solution is to store the date/times in Timestamps format. Taking the above example.. 1st Feb 2008, 10:00 a.m (in India) will be stored as 20080201043000.
    This time if seen in German Time zone will look as : 1st Feb 2008, 05:30 a.m.
    Simple right
    -> In India we store date as DD.MM.YYYY while in other countries they store it as MM.DD.YYYY.
    The separator could be . or - or / .
    The date format is user dependent. I might prefer to store it as DD.MM.YYYY and you might want to store it as MM-DD-YYYY.
    System does not bother what your format is. It always stores in YYYYMMDD (8 Char)
    On screens if you want to display Date then it must always be shown in that users format who is seeing it. How to get this done ?
    DATA : lv_date(10) type c.
    write sy-datum into lv_date.
    So in LV_DATE variable the date will be stores in the users format.
    Simple right
    There are function modules that do the same. But normally we should avoid use of FM to make code simpler, short and easy... no complications at all ..
    You can use system variables sy-datlo (Local Date for Current User) and sy-timlo ( Local Time of Current User ).
    You can also use GET TIME statement.
    reward if useful,
    preet

  • Time difference between local time and server time

    Hi Guys,
    I am currently experiencing a time difference of 40 minutes between the local time and the current server time.
    The local time seems to be 40 minutes slower than my current time.
    Path for Local Time : CMC -> home -> servers -> input.file repository sever -> metrics tab.  (Under the category of Installed on machine peacok, there is a local time.
    Question is how can i sync the local time with my current server time?
    Let me know if more info is required.
    Rgds
    Collin

    Hi Collin,
    Under  CMC >Home >Input FRS , the local time shown is current time of BO Server.
    Since CMC is web-based, any date, time value will be coming from BO Server box.
    u2022     In case your system and BO server is in same time zone  then update the date-time of BO Server
    u2022     In case your system and BO server is in different time zone then check with IT team to figure out the BO Server will be maintained in which time zone.
    u2022     If current requirement is specific to some report then you can add 40 min in all date value in report to get the desired result.
    Thanks,
    Sushil

  • Get date from Oracle when local time zone is different from Oracle time zon

    Hi!
    Local machine time zone= +2
    Oracle time zone= +1
    I set date to Oracle using java.sql.Date.
    From application I save date at 00:30 clock and send e.g. 28.06.2002, but in Oracle date is save as 27.06.2002 01:00 (hour=01 , I suppose that is because java.sql.Date hasn't time the Oracle set it time = time zone=+1) And when I get date from Oracle I get incorrect date. In SQL I don't use date masks. Maybe solution is to use java.sql.Timestamp object (when save date to Oracle) instead of java.sql.Date?
    But if I save date at e.g. 01:00 clock and send e.g. 28:06.2002 in Oracle, date is save as 28.06.2002 01:00 and when I read from Oracle I get correct date.
    Thank you.

    Hi!
    Local machine time zone= +2
    Oracle time zone= +1
    I set date to Oracle using java.sql.Date.
    From application I save date at 00:30 clock and send
    e.g. 28.06.2002, but in Oracle date is save as
    27.06.2002 01:00 (hour=01 , I suppose that is because
    java.sql.Date hasn't time the Oracle set it time =
    time zone=+1) Presumably you are using setTimestamp() to store the value. If you are explicitly using a varchar (string) then you will have to correct the timezone your self.
    And when I get date from Oracle I get
    incorrect date. In SQL I don't use date masks. Maybe
    solution is to use java.sql.Timestamp object (when
    save date to Oracle) instead of java.sql.Date?The method setDate/getDate store a 'date' which is not the same as a 'date and time' for which setTimestamp/getTimestamp are used.
    But if I save date at e.g. 01:00 clock and send e.g.
    28:06.2002 in Oracle, date is save as 28.06.2002
    01:00 and when I read from Oracle I get correct date.
    Thank you.

  • Convert unix time stamp to readable time with daylight saving

    Hello NG,
    I have a table that has a column containing time stamps in the unix time format (seconds since 1970). If I show these times to the user, they should be converted to some readable format. I'm using the following sql code as an example:
    select to_char(
    to_timestamp_tz(
    to_char(
    to_date('01011970','ddmmyyyy') + 1/24/60/60 * 1086508800,
    'YYYY-MM-DD HH24:MI:SS')||' Europe/Warsaw',
    'YYYY-MM-DD HH24:MI:SS TZR'),
    'YYYY-MM-DD HH24:MI:SS TZH:TZM')
    from dual;
    The output I get is the following:
    TO_CHAR(TO_TIMESTAMP_TZ(TO
    2004-06-06 08:00:00 +02:00
    The output is right, but the format I need is the following:
    2004-06-06 10:00:00
    How do I have to alter the statement to get the correct result (add the two hours of the timezone and dst to the time)?
    Any help is appreciated.
    Regards,
    Mario Freimann

    That's the strange thin ... this timezone doesn't exist.
    Running the query I get the error message
    ORA-01882: timezone-region not found
    The results of the statement
    select * from V$TIMEZONE_NAMES;
    for Europe are:
    TZNAME TZABBREV
    Europe/Dublin LMT
    Europe/Dublin DMT
    Europe/Dublin IST
    Europe/Dublin GMT
    Europe/Dublin BST
    Europe/Istanbul LMT
    Europe/Istanbul IMT
    Europe/Istanbul EET
    Europe/Istanbul EEST
    Europe/Istanbul TRST
    Europe/Istanbul TRT
    Europe/Lisbon LMT
    Europe/Lisbon WET
    Europe/Lisbon WEST
    Europe/Lisbon WEMT
    Europe/Lisbon CET
    Europe/Lisbon CEST
    Europe/London LMT
    Europe/London GMT
    Europe/London BST
    Europe/London BDST
    Europe/Moscow LMT
    Europe/Moscow MMT
    Europe/Moscow MST
    Europe/Moscow MDST
    Europe/Moscow S
    Europe/Moscow MSD
    Europe/Moscow MSK
    Europe/Moscow EET
    Europe/Moscow EEST
    Europe/Warsaw LMT
    Europe/Warsaw WMT
    Europe/Warsaw CET
    Europe/Warsaw CEST
    Europe/Warsaw EET
    Possibly something is not right with my installation (Oracle 9.2.0.1.0) ...

  • Appending and add time stamp at a time........

    Hi all,
    i am working on a scenario...
    it is file based..no mapping and bpm can be used.
    I need to pick up file through xi and append it and put in the target with time stamp to it.
    we can achieve this if mapping or bpm is allowed.....
    But,in file processing we can use only one option at a time.....
    I found a way:
    scenario one: files will be appened and kept in a temparory folder
    using another scenario we will pick up the appeneded file and add time stamp and keep in target structure...
    but i dont think this is advisable...
    please suggest me any other ways to achieve this...(can run operating system command be helpfull??)
    thanks in advance..
    Regards,
    Kiran.

    HI,
    Yes you are right, Appending and adding Time Stamp will not be possible simultaneously.
    Refer - this could help you
    Dynamic Filename with TimeStamp  
    Dynamic Filename with TimeStamp
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    But some how you have to use mapping for it. Then if its allowed to use the mapping then as you have suggested, should have to go for two scenarios. No alternative,
    Probably also you can try with Customized Adapter Module for this.
    Thanks
    swarup

  • Converting System Time Stamp to Unix Time Stamp

    Hi All,
      I have a requirement to Convert System Date to Unix Date format.Can any one let me know how to convert system date to Unix Date format. Like function module or any other method.
    Regards
    Anil Kumar K

    Hi,
    I dont know if is this what you want:
    http://javascript.internet.com/math-related/unix-date-time-converter.html
    Hope it helps!

  • Converting cst time stamp to gmt time

    Hi,
    i need a udf for the following requirement
    "Source will be                                                                                Format: 'CCYY-MM-DD-HH.MN.SS.TTTTTTu2019
    Example:  u20182011-04-18-14.32.13.494000u2019
    Destination will be    
    Fomat: 'YYYY-MM-DDThh:mm:ssZ'
    Example: '2002-05-30T09:30:10Z'
    Note: The source date will be in the CST timezone and must be converted to the GMT timezone"
    thanks in advance

    HI praneethrao13 ,
    you try to use below code and before change the code as ur requirement.
    example for UTS to CST:
    ====
    imports: java.util.Date;java.text.SimpleDateFormat;java.text.DateFormat;
    ====
    Date date = new Date();
    DateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss.SSSS");
    DateFormat cstFormat = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss.SSSS");
    TimeZone utcTime = TimeZone.getTimeZone("UTC");
    TimeZone cstTime = TimeZone.getTimeZone("CST");
    utcFormat.setTimeZone(cstTime);
    cstFormat.setTimeZone(utcTime);
    return utcFormat.format(date);
    thanks,

  • Converting data to HH:mm:ss time

    Post Author: tvuprestige
    CA Forum: Formula
    Hi, im new to crystal reports and I need to change output to HH:MM:SS.  Currently, data is in form of seconds only. Any help would be appreciated!

    Post Author: SKodidine
    CA Forum: Formula
    I see the problem.  You said that you created a sum via the wizard.  When you right click on the summary field in the report and then click on Format Field and then in the Common tab, click on x-2 next to Display String, in the formula workshop window, expand the Report Fields.  Within it you should see your summary field with a SIGMA (that looks like a capital E).  It might say something like "E Report Area: Sum of  IWrkgrpQueueStats.tTalkAcd"
    In your formula:
    "totext(({Sum of IWrkgrpQueueStats.tTalkAcd}/60)/60,0,"","") & ":" & totext(truncate(remainder({Sum of IWrkgrpQueueStats.tTalkAcd}/60,60)),0) & ":" & totext(remainder({Sum of IWrkgrpQueueStats.tTalkAcd},60),0);
    Replace the fields above with the field with the sigma.  Dont just type it in, double click on the field and it will be placed in the formula area.  If correctly placed, your formula should look similar to this:
    "totext((Sum ({ IWrkgrpQueueStats.tTalkAcd})/60)/60,0,"","") & ":" & totext(truncate(remainder((Sum ({ IWrkgrpQueueStats.tTalkAcd})/60,60)),0) & ":" & totext(remainder((Sum ({ IWrkgrpQueueStats.tTalkAcd}),60),0);

  • Maintenance Windows Set to Use UTC Time Actually Using Local Time on Client

    Hey All - 
    When patching servers last month, we ran into an issue on a couple of collections.  This month, it's occurring on all of them so far.
    The Issue
    We have about 40 collections for various server groups.  Each has a single maintenance window set for roughly a 4 hour window using UTC time.  
    When advertising a task sequence (or something else) to run only inside of the window, it fails.  Examining the execmgr.log shows the error: "CExecutionRequest::The program may never run because of Service Window restrictions."
    If I open SCCM Client Center, connect to one of the systems, and view Service Windows, I see that they are set, but were set using the hours I set but as if I did not choose UTC when I did.  We are in CST which is a 5-06 hour difference therefore it
    fails to deploy.
    Only Fix So Far
    The only fix found so far is to delete the maintenance window and re-create it using the exact same settings.  After this is done and policy refreshes, Client Center shows the windows correctly.
    The problem with the above fix is that at some point, they seemingly are being corrupted again as some which were fixed last month seem to must be re-created again this month.
    Screenshots / Logs
    Maintenance Window
    8:00PM in our timezone should make it start at 2:00PM CST
    SCCM Client Center Viewing Window of System in Collection Same Window Above Was Applied to
    Any ideas or suggestions?  Thanks!
    Ben K.

    Hi,
    Please review the blog explaining about maintenance windows
    and hopefully it will help you.
    Business Hours vs. Maintenance Windows with System Center 2012 Configuration Manager
    http://blogs.technet.com/b/server-cloud/archive/2012/03/28/business-hours-vs-maintenance-windows-with-system-center-2012-configuration-manager.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to Convert Time Stamp to String for Filename use

    I'm writing an Labview application in which I would like to convert pull time stamp infor from Time Stamp VI and convert to string so I can use to append as part of filename.
    The fomat that I want may look something like basefilename081208_1300.  This would represent a file name that has elements consisting of the date 08/12/08 and 13:00 hours zulu.
    Paul 

    Hello:
    Use the Format Date/Time String VI, and use as the format string the following: %d%m%y_%H%M
     This way you'll get the date string you want. 
    Then concatenate the output to other strings you need to name your file.
    I've attached an screenshot.
    Hope this helps.
    Robst.
    Robst - CLD
    Using LabVIEW since version 7.0
    Attachments:
    datetime string.JPG ‏20 KB

Maybe you are looking for