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) ...

Similar Messages

  • Error when converting time stamp in date time time zone CST  in IC

    Hi Experts,
    We have recently upgraded from CRM 5.0 to CRM 2007. We are using IC WEB Employee interaction center.
    so when agent create service ticket in interaction center and close the ticket on same day we are getting an error saying Error when converting time stamp in date time time zone CST.
    we thought there may be problem while installing SAP CRM by basis team in time zone, but we did not find any problem.
    So please advice how to resolve this issue.
    Regards,
    Teja

    Hi Teja,
    I saw a similar message, and it was resolved by adding a timezone to the user profile defaults tab in SU3. I believe the system has been configured to convert between users' timezone and the system timezone, therefore it needs to know each users' timezone.
    Regards,
    Simon.

  • 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

  • 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

  • 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

  • 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

  • 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

  • CreateODBCDateTime monkeys with Daylight Saving Time!!

    If one uses CreateODBCDateTime to convert a date into the
    proper format for storing in a SQL Server database, and one runs
    this operation on a date between 0200 and 0300 on the day that
    Daylight Saving Time changes, the function will change the time
    forward or backward one hour. IT WILL DO THIS EVEN IF THE DATE YOU
    ARE STORING IS UTC, thus rendering UTC times INVALID because they
    do not have DST. Why does this function monkey with DST at all?

    I have several international web sites on this server, one of
    which has over 100,000 users who have contributed over 70 million
    records, all with UTC timestamps. The problem occurs during the one
    hour period EVERY YEAR when daylight saving time is started. It
    does not do this in the fall when the time reverts. So, yes, the
    problem only occurs during 1 hour out of 8,760 hours, but when you
    start with 70 million records over 5 or 6 years...
    But the danger is for anybody who stores or manipulates a
    date/time OTHER THAN the date/time that is being used internally to
    the server. In other words, if your server is set to Central Time,
    and you have users in Hawaii or Arizona who need to store their own
    date/time, it is likely to apply Central Timezone RULES to that
    date/time, even if Hawaii and Arizona don't use DST.
    Let's say you're scheduling operating rooms in a hospital in
    Honolulu. All the CF routines are going to make sure to shift those
    times forward an hour without warning, have a nice day. In my case,
    it is happening with UTC, but it could be ANY time zone that has
    different rules than the ones on your server.
    Yes, I can probably figure out a different way to process
    times, but this is a massive system with thousands of different
    templates. In fact it affects several pretty massive software
    systems with millions of lines of code, so it's not as if I can
    just change a few SQL queries and be done with it.
    It probably should be a rule for anybody operating a
    ColdFusion server in an international setting, where dates and
    times from different regions might need to be stored in a database,
    to set up the server on UTC time just to avoid this problem.
    Me, I have to
    a. find all the places this will affect in thousands of lines
    of code,
    b. try to decide what impact going to UTC on the server will
    have on things like scheduled tasks, email servers, etc,
    c. then figure out whether there is any way to repair tens of
    thousands of corrupted records

  • Calculating time for different timezone, problems with daylight savings?

    Hi all,
    I try to convert my locale time to a different timezone (like a world clock does). This worked until Europe got "summer time". Then my time calculation went wrong. I just paste the following coding to give you a quick reproducable code.
    I did a lot of googleing but nothing found so far. Also search here in the forum didn't help me solving it. So now I created a post on my own.
    The output of the Java programm is the following (without the colored comments). I just entered these comments to show you where the calculation is right and where it goes wrong.
    I have absolutely now idea about where the chase the error. I am only guessing with "daylight savings issue".
    Hopefully anybody has a good idea.
    Thanks in advance
    John
    Europe/London {color:#339966} *(correct calculation!)*{color}
    daylight shift in millis: 3600000
    Is in daylight savings: true
    19.04.2010 11:28:53
    *Europe/Berlin {color:#339966}(correct calculation){color}*
    daylight shift in millis: 3600000
    Is in daylight savings: true
    19.04.2010 12:28:53
    Australia/Sydney{color:#ff0000} (wrong calculation, shoul 1 hour){color}
    daylight shift in millis: 3600000
    Is in daylight savings: false
    *19.04.2010 20:28:53*
    America/New_York {color:#339966}(correct calculation){color}
    daylight shift in millis: 3600000
    Is in daylight savings: true
    19.04.2010 06:28:53
    Asia/Bangkok {color:#ff0000}(wrong calculation, shoud 1 hour){color}
    daylight shift in millis: 0
    Is in daylight savings: false
    19.04.2010 17:28:53
    Asia/Hong_Kong {color:#339966}(correct calculation){color}
    daylight shift in millis: 0
    Is in daylight savings: false
    19.04.2010 18:28:53
    package test.timezone;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import java.util.LinkedList;
    import java.util.List;
    import java.util.TimeZone;
    public class TZCalc {
    public static void main(String[] args) {
    List<TimeZone> list = new LinkedList<TimeZone>();
    list.add(TimeZone.getTimeZone("Europe/London"));
    list.add(TimeZone.getTimeZone("Europe/Berlin"));
    list.add(TimeZone.getTimeZone("Australia/Sydney"));
    list.add(TimeZone.getTimeZone("America/New_York"));
    list.add(TimeZone.getTimeZone("Asia/Bangkok"));
    list.add(TimeZone.getTimeZone("Asia/Hong_Kong"));
    for (TimeZone tz : list) {
    Calendar cal = new GregorianCalendar(tz);
    SimpleDateFormat formatter = (SimpleDateFormat) DateFormat
    .getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
    formatter.setTimeZone(tz);
    System.out.println("\n"  +tz.getID());
    System.out.println("daylight shift in millis: "  tz.getDSTSavings());
    System.out.println("Is in daylight savings: "  tz.inDaylightTime(cal.getTime()));
    System.out.println(formatter.format(cal.getTime()));
    }Edited by: jbegham on Apr 19, 2010 3:46 AM
    Edited by: jbegham on Apr 19, 2010 3:47 AM

    You should not set the time zone on the calendar since you want the calendar based on UTC.
            List<TimeZone> list = new LinkedList<TimeZone>();
            list.add(TimeZone.getTimeZone("Europe/London"));
            list.add(TimeZone.getTimeZone("Europe/Berlin"));
            list.add(TimeZone.getTimeZone("Australia/Sydney"));
            list.add(TimeZone.getTimeZone("America/New_York"));
            list.add(TimeZone.getTimeZone("Asia/Bangkok"));
            list.add(TimeZone.getTimeZone("Asia/Hong_Kong"));
            Calendar cal = new GregorianCalendar(); // Regardless of your timezone this holds the number of milliseconds since 1/1/1970 UTC.
            for (TimeZone tz : list)
                SimpleDateFormat formatter = (SimpleDateFormat) DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
                formatter.setTimeZone(tz);
                System.out.println("\n" + tz.getID());
                System.out.println("daylight shift in millis: " + tz.getDSTSavings());
                System.out.println("Is in daylight savings: " + tz.inDaylightTime(cal.getTime()));
                System.out.println(formatter.format(cal.getTime()));
            } I have no idea whether or not this then gives the results you expect.

  • SCEP scheduled scan time problem with daylight-saving time?

    Since the daylight-saving time change from last weekend (1 hour earlier) we see that a large group of SCEP clients start their scheduled scan at 11:00 where we have it set in the policy in SCCM2012 at 12:00.
    Most workstations still begin their scan at 12:00.
    Any idea?
    Regards, Bob

    I’m cleaning up old post, did you figure this out yet, if so what was the solution?
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • C6 Calendar issue with daylight saving

    Hi, my C6-00 works fine until daylight saving switches. I am using outlook 2007 and ovi suit to sync between cellphone and PC, both are up to date and both set on China timezone. I started to see some recurrance meetings(those created prior to March by US colleague in outlook) are still showing the old time (I expect them to show up 1 hr earlier in China time because of Daylight Saving in US, just like what I see on outlook), however new meetings created after Mar are fine. Is this a bug?

    I'm guessing it's the Time Server you're using ...

  • Converting unix data to normal date time.

    Post Author: Keshavan
    CA Forum: Formula
    Hi,
    Can anyone help me out on how to convert the unix date time format to normal date time? I should convert this unix data to proper time format also with GMT+5:30 hrs. Please help me to do the same.
    Thanks in advance,
    Keshavan.

    Post Author: V361
    CA Forum: Formula
    Could you provide some samples, I am not sure what a Unix data time looks like.
    Unix date that displays:
    Date you want to display:

  • How to get time stamp of photo taken with an iTouch

    I need to find out the date and time of a photo on an iTouch how do I find it? Thank you

    https://itunes.apple.com/us/app/photo-date/id605218393
    Compatibility: Requires iOS 5.1 or later. Compatible with iPhone, iPad, and iPod touch. This app is optimized for iPhone 5.

  • Can you pull up a time stamp on pictures taken with an iPhone

    I need to know the time and date of pictures taken on my iPhone. Is there away to get that?

    You'll need an app from the app store...search for EXIF viewer, or you can view this data on your computer.

  • 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,

Maybe you are looking for

  • Promlem in creating database in 8.1.7

    hello, I just downloaded and installed 8.1.7 on redHat 7.3. The installation goes through with no problem. But when it comes time to create the database, the dbassist gives me these two errors: ORA-03113: end-of-file on communication channel ORA-0311

  • MSS UWL

    Hi ESS/MSS Experts we are implementing Record working time in your current portal, we have the following requirements can some body pls help. manager approve working time -> what are the UWL capabilities in terms of Manager approving working times, I

  • Cascading prompts are not working after UNX conversion.

    Hi, We have converted universe to UNX format, but after conversion the cascading prompts are not working. Following is the one of the example of the cascading prompt which is having issue: We have cascading object named u201CGroup - Deviceu201D as be

  • 17" Powerbook, 1ghz and a 30" ACD

    I have a 17" powerbook, and drive my ACD 23" just dandy, I just got a 30" in hopes of getting a G5 soon. Can I drive my 30" with a limited amount of pixels and still use it, Like with a black area around it, cause I know the 30" is not compatable at

  • Drag and drop in parallels 6

    I installed trial Parallel 6. I can only drag and drop from windows desk top to mac desktop, iMac. I can nod do the same dragging from Mac to windows XP. I have the + sign but nothing happens. I reinstalled the tools. No change. Is there a solution?