Handling time via oData

G'day,
It seems the blueprint for any date/time handling is the blog post: Working with OData Dates and Times.
I am interested in handling (i.e formatting) a time I am receiving from an oData service.
My problem is that if I simply output what I am being passed I get the following:   PT06H00M00S.
According to the link above this is in JSON format however for me it is what is being returned in odata! Everything in the link assumes you have the time in milliseconds and then use methods to convert the time in ms to an actual time.
The sentence in the link that discusses how the time in the format I have it gets converted to javascript is a bit garbled:
"Luckily if you use the ODataModel, datajs the OData library SAPUI5 uses has regular expressions and code logic which parses these values into JavaScript for us."
Is there a simple explanation of how to format a time received in the format PTxxHxxMxxS (where x is a number) received from an odata service?
The jsbin example given starts with a hardcoded time in ms.
Thanks!

Apologies for the delay but SCN was down when I tried to post yesterday.
I am using an oData model. The details are as follows:
In Controller:
var oModel = new   sap.ui.model.odata.ODataModel("/sap/opu/odata/sap/ZMB_PERSON_SRV/", false);
               var oTableRef = sap.ui.getCore().byId("tabPer");
               var oPlntInp  = sap.ui.getCore().byId("hlpplnt");
               oTableRef.setModel(oModel);
               var oFilPer = new sap.ui.model.Filter('Werks', sap.ui.model.FilterOperator.EQ, oPlntInp.getValue()); 
               oTableRef.bindRows({
                       path    : "/ZMB_SITE_PERSONSet",
                       filters : [ oFilPer ]
In View: (selected code)
var oTable = new sap.ui.table.Table("tabPer", {.............}
oTable.addColumn(new
                       label : new sap.ui.commons.Label({
                              text : "Start Time",
                              design : sap.ui.commons.LabelDesign.Bold                                   
                       template : new sap.ui.commons.TextView().bindProperty(
                                      "text",
                                      "StartTime"),
                       width : "10%"
Thanks for your time Maksim!

Similar Messages

  • Best practise around handling time dependency for flat file loads

    Hi folks,
    This is a fairly common situation - handling time dependency for flat file loads. Please can anyone share their experience around handling this. One common approach is to handle the time validity changes within the flat file where it is easily changeable by the user but then again is prone to input errors by the user. Another would be to handle this via a DSO. Possibly, also have this data entered directly in BI using IP planning layouts. There is a IP planning function that allows for loading flat file data but then again, it only works without the time dependency factor.
    It would be great to hear thoughts or if anyone can point to a best practise document for such a scenario.
    Thanks.

    Bump!

  • I want to copy email from my mac to my pc. Forwarding one at a time via email works well, but when I try to forward several of them at a time I receive one large email. I want to receive the emails individually on my pc. Any suggestions?

    I want to copy email from my mac to my pc. Forwarding one at a time via email works well, but when I try to forward several of them at a time I receive one large email. I want to receive the emails individually on my pc. Any suggestions?

    Don't know any 'automatic' way - but, i have "Fetch Headers only" set on each of my 'secondary accounts'.
    With varying internet service, manual "Get Messages" is probably the "Best Practice" because you will know how good your service is before you even try.
    maybe set "Check for new messages every 'n' minutes" to different times
    (3 minutes, 6 minutes, etc.) on each 'secondary' account.

  • Can't delete more than 5 podcasts at a time via Smart Playlists

    Can't delete more than 5 podcasts at a time via Smart Playlists, using the Shift+Delete keys to force deleting the source podcast.
    Becomes VERY tedious to get rid of old podcasts with certain "smart playlist" filters.
    Advice? Bug?

    I should add that I face the same problem with Safari and Google Chrome.

  • Adobe Acrobat Pro can't handle time zones?

    I normally work in Texas, but at the moment I am in San Francisco. I have updated the time zone on my Mac OS X 10.6.4 system accordingly. When I attempt to certify a PDF using Acrobat Pro 9.3.3, my digital signature (that I just created on the PDF) is considered invalid by Adobe Acrobat because it "appears to be in the future."
    As best as I can explain it, here's what appears to be happening:
    My computer is set to Pacific Time Zone. It's 11:44 AM PDT
    I digitally certify a PDF.
    The Signature Properties say the date of signature is 2010/07/28 13:44:36 -05'00'.
    The timestamp included with the signature is dated 2010/07/28 13:44:36 -05'00'
    For some reason, Acrobat Pro thinks that the signature is invalid because it appears to be in the future. Why
    isn't Acrobat Pro smart enough to handle time zones?
    I'm uncertain as to how this error could be occurring. I am using a timestamp server (http://tsa.starfieldtech.com) to timestamp my digital signature. There doesn't appear to be any preference in Acrobat for time zone support, so it must be determining the local time from the system clock, but without the context of timezone.

    Hi Sasha,
    Was Acrobat running when you reset the system time? If so the original system time (in reality the GMT offset) was loaded into memory at launch and didn't get reset when you modified the System Preference. Acrobat should be able to pick up the new GMT offset, see you are at -7:00 (PDT) and make the changes accordingly.
    As you might have noticed, when it comes to digital signatures, all of the times are in "Generalized Time Format". A lot of people mistake this for "European Time" because the month doesn't come first, but this is an ISO standard where the time starts with the year.
    Steve

  • UCCE 7.5 how to get BHCA and Average Call Handle time?

    Hi everybody,
    I'm trying to do an audit of the existing UCCE system.
    Can someone please tell me how to get the BHCA and Average Call Handle time for agent?
    I did a SQL query against the CallTypeHalfHour table for all the entering Call Type but I'm not sure that's the right BHCA.
    Thanks in advance,
    Best Regards,

    Hi again Geoff,
    Before closing this thread, I'm curious about your query against TCD for average handle time.
    Here's mine using Skill_Group_Half_Hour
    SELECT
        SUM(HandledCallsTalkTimeToHalf) AS TalkTime,
        SUM(IncomingCallsOnHoldTimeToHalf) AS HoldTime,
        SUM(CallsHandledToHalf) AS HandledCalls,
          AHT =
                CASE
                WHEN SUM(CallsHandledToHalf) > 0 THEN (SUM(HandledCallsTalkTimeToHalf) +SUM(IncomingCallsOnHoldTimeToHalf)) / SUM(CallsHandledToHalf)
                ELSE 0
                END
    FROM t_Skill_Group_Half_Hour
    WHERE DateTime between '02/01/11 00:00' and '02/28/11 23:30'
    Besides, can you please also tell me how to get the Average Waiting Time (time before get answered by an agent) ?
    Thank you in advance, Geoff,
    Best Regards,

  • SSAS Tabular: Handling time datatypes

    Folks,
    I have two dimensions related to time in my DW. One is for dates (dDate), and another which is for the time of the day (dTime), with the granularity set to minutes (we don't care for seconds).
    Here is the code for creating my dTime table:
    CREATE TABLE dTime (
    [timekey] smallint, --NOT SURE ABOUT THIS SEQUENCE AS THE PRIMARY KEY ** MUST REVIEW **
    [Hour of Day (24)] tinyint, --0-23, military/European time
    [Hour of Day (12)] tinyint, --1-12, repeating for AM/PM, for us American types
    [Meridien] char(2), --AM/PM
    [Minute of Hour] tinyint, --the minute of the hour, reset at the top of each hour. 0-59
    [Half Hour] tinyint, --1 or 2, if it is the first or second half of the hour
    [Half Hour of Day] tinyint, --1-24, incremented at the top of each half hour for the entire day
    [Quarter Hour] tinyint, --1-4, for each quarter hour
    [Quarter Hour of Day] tinyint, --1-48, incremented at the tope of each half hour for the entire day
    [Time String (24)] char(5), --military/European textual representation
    [Time String (12)] char(5), --12 hour clock representation sans AM/PM
    [Time Value] time(0), --Time in 00:00:00 T-SQL time datatype
    CONSTRAINT PK_dTime_timekey PRIMARY KEY CLUSTERED (timekey)
    GO
    For the sake of completion, I have recently added a time(0) field to my table. I am creating an SSAS tabular model based on data from this DW. However, it comes to my attention that SSAS in Tabular mode does not handle time-only fields. Is that correct?
    Could someone please advise?
    Best Regards,
    P.

    Multidimensional and Tabular are different.
    Tabular has a dictionary for every column, so there is only one data type (datetime) that contain both. If you have a TIME data type in SQL, it is automatically imported in the right way and assigned to a date in the past (1/1/1900 or something similar).
    In order to optimize the column, lower the number of unique values. If you don't need seconds, round to the minute.
    Marco Russo (Blog,
    Twitter,
    LinkedIn) - sqlbi.com:
    Articles, Videos,
    Tools, Consultancy,
    Training
    Format with DAX Formatter and design with
    DAX Patterns. Learn
    Power Pivot and SSAS Tabular.

  • How to handle time&date

    can anyone tell me how to handle time&date correctly?using Calendar,GregorianCalendar,TimeZone,Locale
    thank you very much

    This is too large a topic to discuss in depth here. Here is a link to a tutorial on times and dates, and a search link that references many documents on the subject.
    http://java.sun.com/docs/books/tutorial/i18n/format/dateintro.html
    http://onesearch.sun.com/search/developers/index.jsp?and=calendar+&nh=100&phr=how+to&qt=&not=&field=&since=&col=javatecharticles&col=javatutorials&col=devall&rf=0&Search.x=20&Search.y=7
    When you have specific questions, just ask.

  • Does anyone know a work around to broadcast live (in real time) via video stream through a BC website?

    Does anyone know a work around to broadcast live (in real time) via video stream through a BC website?
    ~Leritha

    There is no work around. You would look to use a service, like Twitch, you get a embed code for the live stream, you put that on a page and away you go. All depends on the service your using.

  • Putaway of Handling units via Inbound delviery

    Hi,
    I have configured HUM for my warehouse & am putting away my handling units via Inbound delivery.
    The system currently generates a transfer order for each & every HU/ storage unit that is created.
    But i would like to create one single transfer order for every storage type. In other words one transfer order will contain all the storage units that are to be put-away per storage type.
    Is there a setting to make the above mentioned possible. Do let me know if more clarity on my question is reqd.
    Thanks
    Kiran

    Hello,
    You could check the To split functionality to see if this can help you complete your requirements.
    http://help.sap.com/saphelp_erp60_sp/helpdata/EN/c6/f83df24afa11d182b90000e829fbfe/frameset.htm
    Further documentation is available if you click the IMG documentation in LE>WM>strategies--> Define stock sequence for stock removal (picking)
    Hope this helps
    Thanks,
    Edited by: Abhijit Sadhu on Jun 8, 2009 4:14 PM

  • I cannot view the family sharing invitation. My wife has sent it multiple times Via email and text yet I haven't had a notification, but when I attempt to send to her she receives the notification. Help please?

    I cannot view the family sharing invitation. My wife has sent it multiple times Via email and text yet I haven't had a notification, but when I attempt to send to her she receives the notification. Help please?

    There are a lot of posts in the forums today with people having problems with iMessage.   There was also a published outage yesterday, so it's possible there are still some issues that may be impacting you both.
    I would just wait it out - I'm sure it will be sorted out soon.

  • Set network time via script or terminal command

    Hi
    We are trying to set our computers to the network time at login.  We tried modifying the MCX time via workgroup manager but that did not work.  I have used my old script/command I used for 10.6 to set our 10.8 machines to the network server but it says command not found.  Been googling to find a command/script that works for 10.8 but so far unsuccessful finding a solution. 
    This is the script/command I used:
    # Set time zone and time server.
    $systemsetup -setusingnetworktime on
    $systemsetup -settimezone America/New_York -setnetworktimeserver time.apple.com
    Any suggestions would be greatly appreciated!
    Cheers

    Why does having the System Preference in Date & Time set  to automatically set the date and time from the Apple servers not work for you?

  • CUIC, Handled Calls and Handled Time problem

    Hello,
    Our costumer uses Outboud Predictive Dialer, UCCE. Everthing works fine but in CUIC reports we do not have almost any information about Handled calls and Handled Time (example in attach).
    Any hints are much appreciated!
    Dusan

    Hi,
    alright.
    One day you will outgrow CUIC anyway, so if I were you I would start thinking about creating a custom reporting solution (if you are a Microsoft shop, it's SRSS, if Java, then perhaps BIRT).
    G.

  • Handling Characters Like # in Data, when exposing HANA views via oData services?

    We've some special characters in the fields (like '#' ), and because of this the client side ODataModel /JSON parsing is breaking when ever the data has these characters.
    Is there anyway to encode this at the HANA server level while exposing the views?

    Hi Latha,
    I've tried numerous combinations but I can't seem to create a view to return the data that I need.
    For example, I thought I would need to create an Attribute view based on the M_TIME_DIMENSION_WEEK table BUT then noticed that I can't join this to my table as I only have a date column, i.e. at DAY granularity.
    Therefore I created an attribute view based on the M_TIME_DIMENSION table to match the  granularity of the Date column in my table and joined this to my foundation table using the SAPDATE column..
    The M_TIME_DIMENSION table also has a WEEK column and I thought I would be able to use that as a basis for the aggregation (SUM) of my Amount column but I haven't been able to make that work.
    So basically I have a table like this:
    MANDT
    NVARCHAR
    COMPANYCODE
    NVARCHAR
    BUSINESSPARTNER
    NVARCHAR
    AMOUNT
    DECIMAL
    CURRENCY
    NVARCHAR
    POSTINGDATE
    NVARCHAR
    And I want to return sums of the amount field based on the WEEK number of the POSTINGDATE field
    The annoying thing is that I can write a simple SQL statement like this to produce what I want:
    select  week(postingdate), sum(amount)
    from myDbTable
    where year(postingdate) = 2014
    and companycode = '123'
    and currency = 'EUR'
    and mandt = '090'
    group by week(postingdate)
    The problem is reproducing the 'week' function in an analytic/calculation/attribute view.
    Of course 'companycode', 'currency' etc would need to be dimensions but I'm sure you understand what I mean.
    Any tips/ideas would be very welcome.
    Kind regards,
    Keith

  • Editing Loop Start and End times via automation / MIDI controllers?

    I'm trying to play a sample in EXS24 and have the Sample Start, Loop Start and End times manipulated over the course of the song. I've tried to open up the EXS sample editor, click on the numerical value of the Loop Start, and then attempt to Learn Automation. All it does is assign the knob for the instrument Volume Level. Is there any way to do this? It's basically how an Akai S612 works: http://www.vintagesynth.com/akai/s612.shtml
    I switched gears and tried it also with Battery, and there's a way to map the Start and End times in there, but it's not seeming to work as I've intended. I can't seem to make the loops move as they should and there's ways to use up to 4 loops, but not a way to target each loop's start and end points via separate controllers.
    I could use my S-612 [and probably will], but in moments where I don't have one available, I'd love to find a solution to this.
    Thanks,
    +odd

    Anyone with any thoughts? would be great to solve this.

Maybe you are looking for