Converting the Number of seconds since 1970 to a YYYY-MM-DD value..

Dear friends,
Sorry if this post is a bit un-related to Java.
I have a requirement of converting a long+ value(no. of seconds since 1970) being obtained from a legacy application to a valid xsd--Date value *(YYYY-MM-DD)* at our side via XSLT.
Does anyone know of any way/function to achieve this in XSLT ?
Thanks in advance...

Thanks a lot for answering, but I am aware that it is easily do-able in either Java, or Oracle DB (using the to_Date() function )...!
But I have encountered this in an XSLT of an ESB product.
And I was wondering if there's any way to achieve this without the overhead of calling any extra component...
Any ideas on this..??

Similar Messages

  • How to set the number of seconds (or time) a photo is displayed on a slideshow (ATV2)

    Can I set the number of seconds a photo stays on the TV screen when I  do a slideshow from my ATV2?   Can't seem to find a setting on the Apple TV to do that.   For the slideshow on the ATV2 I am choosing an Event from my iPhoto library and then choosing "slideshow" after adjusting the ATV2 settings for music and theme.

    You can only set the time of slides with certain types of slideshows (i.e. classic and ken burns)

  • How to set the number of seconds a servlet is allowed to run

    I use JSP to generate a report, but it will take about 10 minutes to search.
    IE Client screen displays an error message what is "Cannot find out your page" after 8 minutes. How to set the number of seconds a servlet is allowed to run.

    It's not a matter of how long the servlet is running... it's the browser timing out because the servlet hasn't responded to its request.
    You have several options:
    1) "Browser Pinging"
    Your servlet sends some small data which can be either seen or unseen (html comments, hidden chars, etc) by the user at short intervals while your report is running. When the report is finished, the browser will not have timed out because it has been "snacking" on those small bits of data which tell the browser its original request was both heard and being handled. I don't think there is any timeout in IE as long as it receives data continually (or at least before its own timeout mark over and over again...)
    2) Multithreaded processing
    This would probably be a better approach. Have the report run in a separate thread running on the server. You'd want to store a reference to this executing report in the user's session. Instead of making the browser wait for the report to be finished, have the servlet check the user's session to see if a report exists and is running. If one does not exist, create one and start its execution. If one does exist, and is still running, print a "please wait" type of message OR an animation, etc... along with some javascript which will reload the page every few seconds. If the page reloads and the servlet sees that the report is finished, it can then display it to the user.
    Hope this helps,
    -Scott

  • Counting the Number of days since Project Kick off for each task

    I'm a bit of a newbie to Project, so forgive me if this is simple.  I have a project plan that 318+/- entries long complete with estimated duration, start and end dates. I'm now being asked to provide these entries (in addition to the dates)
    in cumulative duration.  That is to say that is to say that they want to know how many after the projects kick off will this line item complete. 
    Does  a simple way exist?

    wbicknell --
    Create a custom task Duration field and name it something like Days from Start.  In this custom Duration field, enter the following formula:
    ProjDateDiff([Project Start], [Start], "Standard")
    This formula will calculate the difference between the current Start date of each task and the Start date of the entire project using the Standard calendar.  If your project is using any calendar other than the Standard calendar as the Project calendar
    (Project > Project Information), then enter the name of that calendar in the formula instead of the Standard calendar. In the Calculation for Task and Group Summary section of the dialog, be sure to select the "Use formula" option to force it
    to calculate Duration values for summary tasks.  Hope this helps.
    Dale A. Howard [MVP]
    VP of Educational Services
    msProjectExperts
    http://www.msprojectexperts.com
    http://www.projectserverexperts.com
    "We write the books on Project Server"

  • Convert this number to a date

    Hi, from my database there is a field for date and it is a number like this: 1295944970.   This corresponds to a date displayed as 1/25/2011 displayed on the website.   Does anybody know how to convert the data 1295944970 from the database date field to the actual date of 1/25/2011?   thanks in advance for any help.
    Steve

    The number you are trying to convert to a date is a Unix timestamp and it counts the number of seconds since 1/1/1970
    So to convert that into a date in Crystal you use the following formula:
    dateadd ("s",1295944970-18000, #1/1/1970#)

  • Converting time stamp in SECONDS to a calendar date format.. problems

    Hello. I'm trying to convert a long interger that represents the number of SECONDS passed since the 1970 date
    the number was originally generated by php's mktime() function
    one of the numbers I have for example is this : 1126933200
    I haven't done the math but this is a date probably around september of 2005.. it's irrelevant anyhow.
    I want to convert this to a date format I can use in java. I've tried to create a new date like so :
    Date date = new Date(1126933200);
    I've also tried it with the calendar method like so :
    Calendar calendar = new GregorianCalendar();
    calendar.setTimeInMillis(1126933200);
    it was only then that I realized that both these methods require the number of MILLI seconds. So I tried doing a simple multiplication by 1000 on my original number and then I started getting a "integer number too large" error when trying to compile.
    so i'm kind of at a loss here.. i figure I could make a function myself that would divide my number in days of 86400 seconds.. and then i'd have to keep in mind the bisectal (sp) and the months with more and less days etc.. but i'm sure there must be an easier way.
    and i don't get why a method who's meant to receive a very long number is giving me an error when i try to give one to it.
    your help is appreciated as always. thanks

    Hello. I'm trying to convert a long interger that
    represents the number of SECONDS passed since the
    1970 date
    the number was originally generated by php's mktime()
    function
    one of the numbers I have for example is this :
    1126933200
    I haven't done the math but this is a date probably
    around september of 2005.. it's irrelevant anyhow.
    I want to convert this to a date format I can use in
    java. I've tried to create a new date like so :
    Date date = new Date(1126933200);
    I've also tried it with the calendar method like so
    Calendar calendar = new GregorianCalendar();
    calendar.setTimeInMillis(1126933200);
    it was only then that I realized that both these
    methods require the number of MILLI seconds. So I
    tried doing a simple multiplication by 1000 on my
    original number and then I started getting a "integer
    number too large" error when trying to compile.So you needed to add L to one of the numbers.
    Note you also need to define what timezone that seconds number represents.
    With Gregorian it is going to use the local timezone (the code here will anyways). The code using Date is using the UTC timezone.

  • Problem in converting the String to Date with time zone GMT

    Hi,
    When I tried to convert the string 12/05/2009 to Date, the time zone is set to BST.On the other hand, for the date 12/12/2009, the time zone is set to GMT. What should I do to get the time zone as GMT all the time.?
    SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
    String dateString = "12/05/2009";
    System.out.println(myDate.toString());

    I think you are all missing the point. java.util.Date objects always alway always store the date as the number of milliseconds since 1/1/1970 UTC so the only TimeZone they have its the implicit UTC. When you use the Date.toString() method the toString() method gets the default time zone from your environment and formats the data accordingly. This means that the same Date object will, by default, produce a different result for France and Australia and the US.
    So, if you have the date "12/5/2009" as a String then to convert it to a java.util.Date you must specify what TimeZone is implied. If it is your system time zone then you can just create a SimpleDateFormat object with the correct format and then use the parse() method to create the java.util.Date object and this will automatically be converted to UTC. If the date String represents some other time zone then you must explicitly set the time zone of the SimpleDateFormat object before parsing the string.
    The same approach applies when converting a java.util.Date object to a String. If you want anything other than your system time zone then you must explicitly tell the SimpleDateFormat what time zone you want the result formatted for.

  • To Convert the Case

    Hi,
    i am using the function module to get the amount in words,
    CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
      EXPORTING
        AMT_IN_NUM               = TOT
    IMPORTING
       AMT_IN_WORDS             = WA_SPELL
    EXCEPTIONS
      DATA_TYPE_MISMATCH       = 1
      OTHERS                   = 2
    but the problem is i get the amount in capital letters
    for ex : ONE LAKH TWO Rupees
    but i need the o/p in form
    ex: One Lakh two RUPEES
    how can i convert the case...
    kindly help

    For case translation :
    TRANSLATE
    Variants:
    1. TRANSLATE c TO UPPER CASE.
    2. TRANSLATE c TO LOWER CASE.
    3. TRANSLATE c USING r.
    4. TRANSLATE c ...FROM CODE PAGE g1...     TO CODE PAGE g2.
    5. TRANSLATE f ...FROM NUMBER FORMAT n1... TO NUMBER FORMAT n2.
    Depending on whether byte or character string processing is carried out, the operands can only be byte-type or character-type (see Overview).
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Only character-type fields allowed in string processing.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs.
    See String processing
    Variant 1
    TRANSLATE c TO UPPER CASE.
    Variant 2
    TRANSLATE c TO LOWER CASE.
    Effect
    The first variant converts all lowercase letters in c to uppercase. The second variant converts all uppercase letters to lowercase.
    Example
    DATA letters(3) TYPE C.
    MOVE 'abc' TO letters.
    TRANSLATE letters TO UPPER CASE.
    letters now has the contents 'ABC'.
    Note
    The classification of upper- and lowercase, and the actual characters used are determined by the current text environment (see SET LOCALE LANGUAGE). Problems may occur when the system converts the characters, if the wrong language has been specified in SET LOCALE LANGUAGE, or if data has been processed that does
    Variant 3
    TRANSLATE c USING r.
    Effect
    Replaces all the characters in the field c according to the rule in field r. c1 containscharacter pairs. The second character in each pair replaces the first. If r does not contain a character in c, this character remains unchanged. r can also be a variable.
    Example
    DATA: letters(20) TYPE C VALUE 'abcabcabcXab',
          change(15)  TYPE C VALUE 'aXbaYBabZacZ'.
    TRANSLATE letters USING change.
    letters now contains 'XaZXaZXaZXXaZ'.
    Variant 4
    TRANSLATE c ...FROM CODE PAGE g1 ...TO CODE PAGE g2.
    Parts marked with " ..." are interchangeable
    TRANSLATE c TO   CODE PAGE g2.
    TRANSLATE c FROM CODE PAGE g1.
    Instead you can use conversion classes.
    Effect
    Converts the contents of the field c from character set g1 to character set g2. This variant uses the conversion table g1 to determine the SAP character, which is then used to determine the new character from g2.
    Transaction SPAD allows you to display and maintain character sets. If one of the conversion tables does not exist, the runtime error CONVERSION_CODEPAGE_UNKNOWN occurs. Conversion combinations that are maintained as part of the runtime system for performance reasons do not trigger runtime errors, and you cannot change them using Transaction SPAD.
    Example
    DATA c(72) TYPE C.
    TRANSLATE c FROM CODE PAGE '1110' TO CODE PAGE '0100'.
    This statement converts the contents of field c from the HP-UX character set to IBM EBCDIC.
    Note
    Fields with types I, P, F, and X remain unchanged by the conversion. The syntax check only allows character fields for specifying the codepage. However, since the codepage is maintained in table TCP00 as a type N field with length 4, you should use this type.
    Variant 5
    TRANSLATE f ...FROM NUMBER FORMAT n1 ...TO NUMBER FORMAT n2.
    Parts marked with " ..." are interchangeable
    TRANSLATE f TO NUMBER FORMAT n1.
    TRANSLATE f FROM NUMBER FORMAT n1.
    Instead you can use conversion classes.
    Effect
    Converts the number formats in f. Currently, the number formats '0000' (HP, SINIX, IBM) and '0101' (DEC-alpha OSF) are supported. Other formats trigger the runtime error TRANSLATE_WRONG_NUM_FORMAT . If you omit FROM NUMBER FORMAT or TO NUMBER FORMAT, the system uses the system number format.
    Example
    DATA: f TYPE F,
          hex(2) TYPE X,
          nform LIKE tcp00-cpcodepage.
    The contents of fields hex and f are stored in /ARCHIV
    from another platform. hex is stored in a valid number
    form when it is saved, and can therefore be read on
    all platforms.
    READ DATASET '/ARCHIV' INTO hex.
    READ DATASET '/ARCHIV' INTO f.
    nform = hex.  "Conversion from non-host-specific. HEX into N(4)
    TRANSLATE f FROM NUMBER FORMAT nform.
    Effect
    Converts the contents of f from the nform format of a given platform into the system representation.
    Note
    This converts fields with types I and F. As in variant 4, you should define the number formats with type N and length 4.
    You can display system codepage and number formats using the function module SYSTEM_FORMAT. This allows you to store additional information for archiving purposes.
    Note
    Performance:
    Converting lowercase letters to uppercase (or the other way round) in a 10 byte character field requires around 7 msn (standardized microseconds).
    If you use ... c USING c1... to replace two characters of a 10 byte character field,the runtime is around 9 msn.

  • How do you limit the number of rings before your answerphone kicks in?

    People calling me have sometimes complained that if I am not available to take the call, they have to wait for many rings - and hence a long time - before the messaging system kicks in. And sometimes, callers give up, assuming I don't have voicemail. I know you can limit the number of rings on other phones, but I haven't founf out how to do it with my iPhone. I'm sure it's easy though!!

    Your carrier sets this by time, not the number of "rings" since different ring tones take different times/ring.  The typical setting is 30 seconds, sometimes up to 40 seconds.  Contact your carrier to shorten it.

  • How do you regulate the number of emails that are kept on your phone before they are deleted?

    HOW DO YOU CHANGE THE NUMBER OF EMAILS THAT ARE KEPT ON YOUR PHONE BEFORE YOU DELETE THEM?

    Your carrier sets this by time, not the number of "rings" since different ring tones take different times/ring.  The typical setting is 30 seconds, sometimes up to 40 seconds.  Contact your carrier to shorten it.

  • Can the number format be controlled with custom css styles

    I have a union query where the first query returns a count that I formated as a number '999,999' and the second query returns percentages that I want formatted as '99.9%' I can use conditional formatting to determine which part of the query the result came from but conditional formatting doesn't allow me to control the number format so I was wondering if custom css styles would allow me to control the format. Is converting the number to a character and concatenating a % sign ia better option. I was able to do this using BI Publisher and a different apporach but I want to be able to do it with Answers.

    Make sure the address bar in Contribute is displaying your URL and
    not a file path.
    Your administrator can remedy this by going to the role settings and making sure the Home address is set to the URL.  If you can't get the admin to update the role settings, you can enter your URL into the address bar and then the site should be able to find linked style sheets.

  • How to find the number of executions of a sql oracle 10g

    Is there any script handy which is useful to get the number of executions of a sql in particualr time in a rac environment.

    A lot depends on what time period you're trying to count the executions over...
    In V$SQL, there is a column EXECUTIONS that will count the number of executions since the SQL statement was loaded into the shared pool, which may be too long a period or too short a period for your question.
    If you are trying to get historical information and you have licensed the performance & tuning pack so that you can get the AWR, you could query the DBA_HIST_SQLSTAT table over an appropriate set of SNAP_ID's to get the totals for an arbitrary period of time.
    Justin

  • How can i take the number of a random process to use it in math´s and show the solution to the user?

    i wrote this function and i try to show the number of seconds the user was to early or to late to click the stopbutton to the user.
    its about to hit stop intuitiv while in the background ther is a random number already made but the user dont know or see it.
    the eyes opens in a random between 100 and 40000 millisec. if they open up the user should click stop without seeing them. so its intuitiv.
    i just tryed.
    this code is on the mc with the eyes to let them open randomly. it is on the second frame at the main time code. 1st frame is the start button and a small description. on the second the stop button and the closed eyes with the script down here as i already said. and on the 3rd frame is the end wher it should be shown to the user. thats how i tryed. please let me know any suggestions and or other solutions to my problem! If you need to see my flashfile to help me just let me know. i send it to you or something :-)
    mic(at)hellrec.at
    function randomRange(minNum:Number, maxNum:Number):Number
        return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);
    var myTimer:Timer = new Timer((randomRange(100, 40000)),1);
    myTimer.addEventListener(TimerEvent.TIMER,openeyes1);
    myTimer.start();
    var duration:uint = getTimer();
    function openeyes1(e:TimerEvent):void {
    gotoAndPlay (26);
    e.updateAfterEvent();

    to save the number use:
    function randomRange(minNum:Number, maxNum:Number):Number
        return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);
    var randomNum:Number= randomRange(100, 40000);
    var myTimer:Timer = new Timer(randomNum,1);
    myTimer.addEventListener(TimerEvent.TIMER,openeyes1);
    myTimer.start();
    var duration:uint = getTimer();
    function openeyes1(e:TimerEvent):void {
    gotoAndPlay (26);
    e.updateAfterEvent();
    p.s. please mark helpful/correct responses.

  • Need Help on How to Convert a Number Field to an Hour/Minute

    Post Author: syracuse2
    CA Forum: Crystal Reports
    I have a field that shows a duration, i.e. 125.  I would like to convert the number of 125 to 2hr and 5 min.  Any suggestions on how to do this?

    Post Author: GraemeG
    CA Forum: Crystal Reports
    Create a formula and paste the following into it (sorry I use Basic Syntax):
    'Ive laboured a point here a bit so you can get an idea of what you can do.
    'Heres 3 variables - one with your duration and two others for hours and minutesshared xDuration as numbershared xHours as numbershared xMins as number
    'Put some data into the duration and calculate the hours and minutesxDuration = 125xHours =  truncate(xDuration/60)xMins = remainder(xDuration,60)
    'You can then use the variables to get a string with unformatted hours and mins'formula = xHours + "hours " + xMins + "Mins"
    'or you format the hours and minutes nicely'formula = CStr(xHours,0) + "hours " + CStr(xMins,0) + "Mins"
    'or you can make it all into one formula without the need for xHours and xMins variablesformula = CStr((truncate(xDuration/60)),0) + "hours " + CStr(remainder(xDuration,60),0) + "Mins"

  • Number of seconds played when reproduction is interrupted

    Hi.
    Sorry if my english is not all right. I´m from Spain.
    I have a Server-Side Script which appends some stored mp3
    files to a stream. In some moment, client can invoke a function
    which stops the reproduction and i need to store the number of
    seconds the interrupted audio segment was played.
    I tried to solve it by using the javascript Date object in
    this way:
    -just after NetStream.Play.Start event is launched, i store a
    timestamp: application.initialInstant = new Date();
    -just after NetStream.Play.Stop event is launched, i store a
    timestamp: application.finalInstant = new Date();
    -var milisecondsPlayed = application.finalInstant -
    application.initialInstant;
    This does not work all right. The result is that, in example,
    if the complete segment dures 30 seconds, this way counts about
    27-28 seconds.
    Does anyone know how to improve this?
    I think(but I don´t know) it could be related to the
    Server-Side Stream out-buffer because of the NetStream.Play.Stop
    event is launched when there is no more data to append from the
    file in server´s filesystem to the Server-Side Stream
    out-buffer, but before all data in Server-Side Stream out-buffer is
    flushed.
    Thanks a lot.
    #Edited:
    I have checked the bufferTime property in the Server-Side
    Stream has 0 as value, so my idea is not right.
    I hope anybody could guide me to get my purpose.

    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.

Maybe you are looking for

  • Safari and multiple desktops?

    This is the scenario... 1) Safari's window is running on Desktop A. 2) There is another Desktop B. How do I start another Safari window on Desktop B? When I go to Desktop B and start another Safari window, it is opened on the Desktop A. I know I can

  • Bank charges for DD

    Dear All, My client would like to send DD (Demand draft) to vendor and bank charges are bing made by my client. So, to be able to achieve in SAP Configuration where i have to configure (In FBZP) or where else. they are using APP (F110) how the bank c

  • An information about follow up transaction document

    Hi all, How can i retrieve information about follow up transaction document. I need to know which table or anything else that can give me information about follow up document. For example if i have this business scenario : from contract --> follow up

  • How to disable warning message?

    i design a form. when i close the form by using default close button, it showing a message box do you want to save changes you made? can i deisable this message, how? thanks yash

  • 7610 says 'contact retail service' when switched o...

    nokia 7610 fell in water. and now when switched on it says contact retail service. please help.