Convert milliseconds of time in dateTime in XQUERY

Hi all

I have a requirement to convert milliseconds of time in dateTime in XQUERY OSB. Can you help me please?

Ex: 1445495501169

Concerning

Hi Aditya,

You can try the code in the snippet below.

declare function xf:test ($epoch as XS: long)

as XS: DateTime {}

XS:DateTime("1970-01-01T00:00:00") + ($epoch * xdt:dayTimeDuration('PT0.001S')))

};

It will be useful.

Tags: Fusion Middleware

Similar Questions

  • What to do for the main database when a physical database ensures converts a standby time of the snapshot

    Hello

    Need of the primary database to implement the flashback database when a physical database ensures converts a standby time of the snapshot? Or something to do with the primary database? I find some documents this work to allow the return of flame for the primary databases, but I think that he didn't need to do.

    Thank you

    Best regards.

    I did recently, I have not configured flashback on primary, only configured in the standby mode. I converted the standby database and restored the changes after the test. Primary database continued to send archives to the standby site. Instant once converted into sleep mode, as mseberg mentioned overlaps with the sync state after starting MRP.

  • Convert number in time?

    Hello
    I need a query that convert number in time. Please provide a solution.

    Thank you

    Hello
    use following code:

    select lpad(trunc(nvl(&number/60,0),0),2,'0')||':'||lpad(mod(&number,60),2,'0') time
      from dual
    

    PS

  • Doesn't have JHeadstart capable of converting Forms 10g times 11g and 10g ADF Faces?

    We would like to buy for JDeveloper 10.1.3.3 JHeadstart generator g 10 forms to ADF Faces. This version of JHeadstart capable of converting forms 10g 10 g ADF Faces. But I want a universal JHeadstart generator ADF Faces, who will be able to convert forms 10g times 11g and 10g ADF Faces. Please help me by your valuable suggestion/advice.

    Try asking on the JHeadstart forum:
    JHeadstart

    As far as I KNOW, JHeadstart 11 g is still not released.

  • Convert time UNIX DateTime in the creation of view script

    So, I'm trying to create a view that captures data in different tables 4 like this:

    create or replace view as

    Select distinct a.id, a.time, a.location, a.val

    a. a, B, b, C, c, D d

    where (a.id = b.id) and (b.id = c.id) and (c.id, d.id =)

    This is a c# code I have:

    public static DateTime DateTimeFromUnixTime (long timeT)

    {

    Return epochDate + new TimeSpan(timeT * TimeSpan.TicksPerSecond);

    }

    I guess that it is a function to convert I found: ('1970-01-01', "YYYY-MM-DD") + numtodsinterval(1244108886,'SECOND');

    I would like to format YYYY-MM-DD hh: mm:

    the a.time in time is unix, which is a decimal number for a long time. How I somehow convert it to Datetime format in the above sql Design view?

    that would require a subselect and join back based on id I guess.

    for example

    CREATE OR REPLACE VIEW display AS
    SELECT DISTINCT a.id,
                    to_char(to_date('1970-01-01',
                                    'YYYY-MM-DD') + numtodsinterval(a.time,
                                                                    'SECOND'),
                            'YYYY-MM-DD HH:MM:SS') AS time,
                    a.location,
                    a.val,
                    d.stacount
      FROM a a,
          b b,
          c c,
          d d,
          (SELECT ID, COUNT(DISTINCT(a.STA)) stacount FROM a GROUP BY ID) d
    WHERE (a.id = b.id)
      AND (b.id = c.id)
      AND (c.id = d.id)
      AND (a.id = b.id);
    
  • Problem to convert milliseconds to date

    Hello:

    I have a long type with milliseconds which have information from an external source. This information is GMT + 1 dates from the period. The problem is that if I convert it to a Date of (Date d = new Date (xmilliseconds)), the result is different in Simulator and real device. I have in this time zone GMT + 1 devices. What can I do to resolve this difference?

    Thank you.

    The java.util.Date object is simply a wrapper for a value of type long, counting the milliseconds from the time (midnight UTC 1970-01-01).

    long millis = 1240849164046l;
    java.util.Date date = new java.util.Date(millis);
    boolean alwaysTrue = (millis == date.getTime()); // regardless of phone's timezone
    

    SimpleDateFormat, however, depends on the phone zone.

    long tzOffset = TimeZone.getDefault().getRawOffset();
    System.out.println("Default Timezone offset: " + tzOffset);
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
    System.out.println("Epoch: " + sdf.format(new Date(0l)));
    long now = System.currentTimeMillis();
    System.out.println("Now: " + sdf.format(new Date(now)) + " (millis = " + now + ")");
    
    In Chicago outputs:
    Default Timezone offset: -21600000
    Epoch: 1969-12-31 18:00:00 America/Chicago
    Now: 2009-04-27 11:20:15 America/Chicago (millis = 1240849215406)
    
    In Tokyo (at just about the same moment) outputs:
    Default Timezone offset: 32400000
    Epoch: 1970-01-01 09:00:00 Asia/Tokyo
    Now: 2009-04-28 01:19:24 Asia/Tokyo (millis = 1240849164046)
    

    Note that 0 millis formats 'evil' (not midnight) in both cases. It is not a bug, it's how it is supposed to work.

    System.currentTimeMillis () returns the milliseconds from the time (no matter what time of the phone). If everyone called him at the same time, we would have to pretty much the same result (small variations for the clocks that are a little faster or a little slow).

    If everyone calls new (Date()) sdf.format at the same time, we would each get local time. That's what we want to achieve. That's why SimpleDateFormat compensates millis since the time for the local time zone before formatting.

    If you want SimpleDateFormat to show the millis count as-is, you need to compensate with the local time zone as follows:

    sdf.format(new Date(millis - TimeZone.getDefault().getRawOffset()))
    

    This will return the same string regardless of the phone's time zone. With millis = 0 This reformatted as midnight 1970-01-01, new, independently of the phone's time zone.

    As the external source is GMT + 1, the returned string will be off by one hour. It may be a good idea to move the source external to UTC when you import it. This way you can do the math as (System.currentTimeMillis () - externalTime) and get the correct answers.

    Cheers, Barak.

    p.s. The GMT and UTC are not the same thing. They are a few seconds apart, which makes no difference for non-scientific applications.

  • by the numbers, how can I convert a start time and end in hours time

    I convert my files to Excel, and no to not translate my formulas.

    I have a start time, end time, and hours, what formula should I use to have hours to calculate?

    Thanks for any help

    by the numbers, you can perform mathematical operations on time like this... assuming they are valid values for date/time...

    Assuming that one time is in cell A1 and the other is in A2, you can get the difference like this:

    = dur2hours(a1-a2)

  • How to get out milliseconds of time function?

    Hi all

    I use the time function to get the current time of the step. I get only in the format HH and impossible to get milliseconds. Milliseconds are however get updated locally. I'm not able to get in the final installment

    Is anyway to get the milliseconds of the temporal function?

    I don't think you can do this with the function directly.

    You'll just have to concatenate the value ms!

    "Locals.timeString = Time (False, Locals.hours, Locals.min, Locals.sec, Locals.ms), Locals.timeString +=". "+ Str (locals.ms)

  • convert string to time format

    I have a channel registered in a MM/DD/YYYY HH: mmS.XXXX format and I would like to convert it into a digital representation.  I read on the forums that it will be the number of seconds since AD 0, which I am fine with.  I just need to convert all of the channel in the number of seconds.

    I'm trying to process data with a funky random sampling rate, and I am trying to use the ChnMapLinCalc function to redistribute data on a sampling frequency that makes sense.

    Thank you!

    Steve

    Hi Steve,.

    If the data channel that you are talking about is already loaded in the data portal, and she already has a clock to the left of this symbol in the data portal, then all you need to do is change the display of the values of the layer.  Tiara time channels are regular DBL channels that have a display property set to display the data differently in DIAdem (such as a date/time string).  If you do not need to convert anything.  Locate the "Display Format" property in the data portal and change of 'Time' to 'digital '.  You may need to force a refresh by clicking in the VIEW, but this channel should display immediately in the form of double values.

    Brad Turpin
    Tiara Product Support Engineer
    National Instruments

  • Timestamp is always converted to universal time?

    By applying the function 'get Date/Time' and ' Date/Time seconds to ', it seems that they are forcing UTC after conversion, even if the option for the UTC is false.

    I would like to have the actual system date and time available (which represents for the summer time and time zone as shown on my PC) out of timestamp, but instead I get a value for the timestamp value that (I assume) is UTC. When I probe output of timestamp, or the output of cluster, it seems OK. However to estimate the number of timestamp, it is always disabled by what looks like the difference of the DST and time zone (exactly 5 hours).

    I tried two different methods and find the same results.

    (1) out of ' Get Date/Time ' function directly (which specifies the timestamp will be universal time in its contextual help file)

    and

    (2) convert the timestamp in a cluster and reconvert it timestamp (as pictured).

    In the example attached photo, notice the cluster result (probe 25) shows the correct time (16) when broken down and the probe of timestamp (26) seems correct.

    However, when the timestamp of the function "get Date/Time" or function "Date/Time seconds to" is converted to U32, changes of time what time looks like UTC as the timestamp 3485539686 (probe 28) has the offset of 5 hours (21 as shown in Excell sheet calculations included in the image).

    I'm not simply subtract 18 000 seconds to account for this difference (as DST or time zone changes may cause problems). I would like to than the actual time of the PC to use for the generation of table.

    How can I do this?

    Why do the probe points show the time system correct, but just after the timestamp is converted to U32 it resembles the UTC?

    You can use GetTimeZoneInformation to get through the time stamp and add/subtract out.  It's not like I had to code that WinAPI evoke yet, so I can't provide for you.  The return value indicates also advanced.

    You can also take your timestamp as you did and convert the cluster and return to determine the offset.  I've only done a few testign base with this, so don't know if it works in all use cases.  The WinAPI method would be the most robust.

    This completes actually missed the date upward, but returns the correct offset.

  • By comparing the time of datetime objects part in my form

    Hello. I'm trying to compare some datetime objects on my form. In my form, these elements are formatted as HH12:MIPM, even if they contain a datetime value. I believe that my statement is a failure because the part of date for datetime values is different.
         if :cc_call_lists.NBT_LOCALDATETIME between :nbt_best_call_tm_start and :NBT_BEST_CALL_TM_END then
    Is there a way to make this comparison using only the time portion of the datetime value?

    So I need my IF statement to fire anyway: cc_call_lists. Is NBT_LOCALDATETIME 01/05/2013 14:00, and: nbt_best_call_tm_start is 15/05/2013 12:00 and: is NBT_BEST_CALL_TM_END 15/05/2013 16:00.

    Any help would be greatly appreciated. Thank you.

    You will need to remove the date part for two items, maybe something like this:

    -- check if first time is smaller second time
    IF (:THEFIRSTDATE-TRUNC(:THEFIRSTDATE)) < (:THESECONDDATE-TRUNC(:THESECONDDATE)) THEN
    
  • Convert date and time column column

    Hi all

    I want to convert the date column to date-time column in the place of time, should be set from 07:00

    example of

    26/10/12-07:00

    I have sysdate who only date and I added 1 to that date and now I must include part time and want to display as mentioned above.

    TO_CHAR (sysdate + 1) is the column that I already now for this column, I add time portion(07:00:00AM).


    Please help me with the same.

    Thanks in advance.

    When you insert the column date, then insert it using 07:00 in time, like the big ones showed you (trunc (the_date) + 7/24)

  • Convert varchar2 in time does not work

    Hello

    I have a column called verkaufsuhrzeit Varchar2 (4 Char). The format of the time in this column is HH24MM (Te 624 means 06:24). Now, I'm trying to get the expiration of the present time.
    SELECT (to_timestamp(TO_CHAR(Verkaufsuhrzeit,'0000'),'HH24:MI')) as Zeit from mv_auswertung
    gives me a Date as 01.03.13 06:29, 000000000

    select to_char (to_date (Verkaufsuhrzeit, 'HH24MI'),'HH24:MI') Zeit from apexptrm.mv_auswertung; 
    tells me that hour must be between 0 and 23


    Is it because the 0 from the beginning is missing?

    So, how can I get the 06:24 by 624. Do I need to add a case if the length is 3 a zero should be added?

    Thorsten wrote:

    nordine B wrote:
    Please try "fmHH24MI"... not tested

    Still the same error:

    Put the NLS_DATE_FORMAT and try

    SQL> alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS';
    
    Session altered.
    
    SQL> select to_date ('0140', 'HH24MI')
      2   from dual;
    
    TO_DATE('0140','HH24
    --------------------
    01-MAR-2013 01:40:00
    
    SQL> select to_char (to_date ('0140', 'HH24MI'),'HH24:MI')
      2    from dual;
    
    TO_CH
    -----
    01:40
    
    SQL> 
    
  • Convert number to time Format

    Hello

    I'm trying to find how to display a number in the format hour, Minute, and second.

    I have a data in my table that store the number for example. 145.586956521739

    I want to convert in HOUR, Minute Secode report format.

    Any help is greatly appreciated.

    Thank you
    Poojak

    Say total = 189,89 minutes

    hours = round(total/60)

    minutes = round (mod(total,60))

    second round = (mod(total,1) * 60)

    Sorry if I misinterpreted your question.

    Thank you
    Jalila

  • XQuery - conversion of Date time

    Hello.

    I have a requriement to convert the time format date in Xquery.

    I need to convert the format "YYYY-MM-ddTHH" YYYYMMDDhhmmss format. I checked the XQuery functions. The one you suggest if there is any inbuild function in Xquery to achieve. Thanks in advance

    Hello

    You can use the replace() with a regular expression for re - format the string:

    let $dt := "20110106203437"
    return 
    {
     xs:dateTime(
       replace(
         $dt,
         "^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$",
         "$1-$2-$3T$4:$5:$6"
       )
     )
    }
    
    
    2011-01-06T20:34:37
    

Maybe you are looking for

  • How to open a .bin file?

    File Association problem File type: binary data file File extension: file .bin for sync This is a video training DVD: 'learn Quickbooks Pro 2011.

  • Processor/fan continues to run even after turning off the laptop

    I'm using Inspiron 15 3542 I've updated my OS to Windows 10, but sometimes will not stop the fan from the processor/even after discontinuation of the laptop (as well as the display goes off)! The fan continues and continues. And after this laptop won

  • How to password - protect a text field button?

    With the help of Adobe Acrobat DC.A final touch on page 1 is titled: "the next Page: ADMIN only '."How do I password protect the button at the place where rises clicks the button, a password box would jump to the top (so that the next page access is

  • How do I download items 12, from old computer to new computer

    How do I download items 12 of the old to the new computer

  • bad audio file

    I don't really know what's happening or what's causing this problem.When I read my calendar, all of a sudden my audio file reproduces the wrong file. If I "reveal in finder" he links to the correct file. Even if I "reveal in the project." If I double