MDM Time field looses 12 hours - why ?

I get DateTimeValue  from MDM, using Java Api   RetrieveLimitedRecordsCommand,
it returns correct data-time, except HOUR - it always smaller than 12,
and no AM PM signs is presented at API, as I see (may be wrong).
So, does anybody know how to resolve this problem with Time value ?
Where to get AM PM or 24 hours value ?
http://help.sap.com/javadocs/MDM/SP06P2/com/sap/mdm/valuetypes/DateTimeValue.html
thanks in advance.

Hi Vladimir,
  Try to format the date obtained from MDM:
private static final SimpleDateFormat DATE_FORMAT =
          new SimpleDateFormat("ddMMyyyyHHmm"); //HH indicates Hour in day (0-23)
DateTimeValue dateTimeValue = (DateTimeValue) value; //value is the MDMValue retrieved from MDM          
date = DATE_FORMAT.format(dateTimeValue.getDate());
Please, refer to SimpleDateFormat class in JAVA API Documentation for more information.
Regards

Similar Messages

  • Add 1 hour to date/time field in list

    I need some help understanding the Date/Time fields in SharePoint Online. I've created a list with 2 date/time fields... StartDate and EndDate. I want the StartDate field to default to the current date/time. I want the EndDate field to default to the current
    date/time + 1 hour. I've tried numerous formulas in the default calculated value for these fields, and couldn't get it right. I finally got it, but I don't understand why. Here is the scenario:
    ***Note: Time Zone is set to UTC+5 (EST). Current Time is 8:45am
    Attempt 1:
    StartDate - Selected "Today's Date" for the Default Value
    EndDate - Selected "Calculated Value" for the Default Value. Entered the formula
    =now()+TIME(1,0,0) 
    Actual Results - StartDate: 5/28/2014 9:00am  EndDate: 5/28/2014 6:45am
    Attempt 2:
    StartDate - Selected "Calculated Value" for the Default Value. Entered the formula
    =now()
    EndDate - Selected "Calculated Value" for the Default Value. Entered the formula =now()+TIME(4,0,0) 
    Actual Results - StartDate: 5/28/2014 5:45am  EndDate: 5/28/2014 9:45am
    Attempt 3:
    StartDate - Selected "Calculated Value" for the Default Value. Entered the formula =now()+TIME(3,0,0)
    EndDate - Selected "Calculated Value" for the Default Value. Entered the formula =now()+TIME(4,0,0) 
    Actual Results - StartDate: 5/28/2014 8:45am  EndDate: 5/28/2014 9:45am
    So on attempt 3, I finally got the results that I was looking for. However, I don't understand a couple things:
    1. Why does selecting "Today's Date" for the default value, not select the current time?
    2. Why do I needed to offset the hours by 3 to get the current time?
    Thanks in advance,
    cflbasser

    The now function in my environment gives me the time in which the server is housed. If I change the regional settings it does not have an effect on the time. I'm guessing this means that your server is hosted in the UK or somewhere near there and the regional
    settings don't have an effect.
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • HT201250 If time machine backups hourly.  Why does it need to backup daily, weekly and monthly

    If time machine backups hourly.  Then why does it need to backup daily, seekly, and monthly?

    It doesn't.
    What it does is discard intermediate backups at the end of 24 hrs and keep just three spaced backups from the previous day.
    At the end of the next day, that day's will be reduced to 3, and the previous 3 trimmed to one; the last backup of that day.
    Daily backups are kept for a month, then trimmed to the last backup of the week.
    The weekly backups are kept until the disc runs out of space and TM starts deleting the oldest ones.

  • Rounding time field to nearest half hour

    Post Author: fiscyn
    CA Forum: Formula
    Is there a way to round a time field?
    For example,  if a time field is from 9:01 to 9:14  I want it to round back to 9:00;  
    9:15 to 9:29  or 9:31 to 9:44   I want either option to round to 9:30
    and 9:45 to 9:59 I want to round to 10:00.
      I want to keep the original time and have the rounded time listed next to it.    Also I want this for a 24 hour clock, military time.  Don't know if that makes a difference.
    Any help is appreciated.
    Thanks.

    Post Author: fiscyn
    CA Forum: Formula
    I'm slowly getting this to work.    Just a couple problems,  minor I hope.
    I used the CTime function and used the rounding formulas for minutes and hours as you suggested.  It works great.   But the results for the hours come out as 12.00  and the minutes as 30.00 or 0.00.   How do I drop the decimals?   I tried the totext, 0 function,  but the numbers don't line up correctly.   If the hour is 9.00,  it drops the zero place holder.   So if 9 and 10 are lined up,  the 9 is above the 1 instead of the 0.  
      It works fine for the minutes except I end up with 0 instead of 00.   Any suggestions?
    I greatly appreciate the help so far.   Thank you.

  • How do you calculate difference in time (hours and minutes) between 2 two date/time fields?

    Have trouble creating formula using FormCalc that will calculate difference in time (hours and minutes) from a Start Date/Time field and End Date/Time field. 
    I am using to automatically calculate total time in hours and minutes only of an equipment outage based on a user entered start date and time and end date and time. 
    For example a user enters start date/time of an equipment outage as 14-Oct-12 08:12 AM and then enters an end date/time of the outage of 15-Oct-12 01:48 PM.  I need a return that automatically calculates total time in hours and minutes of the equipment outage.
    Thanks Chris

    Hi,
    In JavaScript you could do something like;
    var DateTimeRegex = /(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d)/;
    var d1 = DateTimeRegex.exec(DateTimeField1.rawValue);
    if (d1 !== null)
        var fromDate = new Date(d1[1], d1[2]-1, d1[3], d1[4], d1[5]);
    var d2 = DateTimeRegex.exec(DateTimeField2.rawValue);
    if (d2 !== null)
        var toDate = new Date(d2[1], d2[2]-1, d2[3], d2[4], d2[5]);
    const millisecondsPerMinute = 1000 * 60;
    const millisecondsPerHour = millisecondsPerMinute * 60;
    const millisecondsPerDay = millisecondsPerHour * 24;
    var interval = toDate.getTime() - fromDate.getTime();
    var days = Math.floor(interval / millisecondsPerDay );
    interval = interval - (days * millisecondsPerDay );
    var hours = Math.floor(interval / millisecondsPerHour );
    interval = interval - (hours * millisecondsPerHour );
    var minutes = Math.floor(interval / millisecondsPerMinute );
    console.println(days + " days, " + hours + " hours, " + minutes + " minutes");
    This assumes that the values in DateTimeField1 and DateTimeField2 are valid, which means the rawValue will be in a format like 2009-03-15T18:15
    Regards
    Bruce

  • Time field is filled with "0:00:00" problem

    Dear,
    I have three fields "Actual Hours","Actual Start","Actual End".User can fill "Actual Hours" or "Actual Start","Actual End" and calculate "Actual Hours" by "Actual Start" and "Actual End".
    If the  "Actual Start" field is filled with 0:00:00,  if using the actual end time to minus the actual start time, the result should be 16, but the result is empty. 
    Quick feedback will be appreciated!
    Best regards,
    Hu Hongfeng
    Tags edited by: Michael Appleby

    Dear Jason,
    Thanks for your replay!
    I want to calculate 'Actual Hrs' by 'Time' and 'To' or directly fill the 'Actual Hrs' without 'Time' and 'To' ( that why i use special values)
    Now when the 'Time' is filled with '0:00:00', it may judged none (you didn't fill any value).
    e.g.
    The 'Time' field is filled with '0:00:00' and the 'To' is filled with '8:00:00'. The correctly value of 'Actual Hrs' should be '8', but now can't calculate.
    Best Regards,
    Hu Hongfeng

  • Time field F4 help:  Is 24:00:00 a valid value?

    I was surprised when one of my recursive codes went out of stack memory since i didnt originally write it to reach 24:00:00 after 23:59:59
    I was further surprised when i observed that the F4 help for a time field enlists values 00 to 24 in the drop down.
    Is this a bug by SAP?
    24 is never a valid value in the 24 hour format, neither in the real world nor cyber.
    It would be ambiguous to denote the midnight of a particular date D1 by this notation since both the following would mean the same thing:
    Date D1 ; Time 24:00:00
    Date (D1 + 1)  ; Time 00:00:00
    Still trying to justify the reason behind this being allowed by SAP.
    Can anybody help me be theoretically content?

    Hello Experts,
    I am also have similar question, why SAP allowed 24:00:00 for data type TIMS ?
    Can someone please provide an insight?
    Thanks

  • How to show a time field in a form portlet

    Hi,
    I am not familiar with PL/SQL and I was wondering how I could show a time field on a form portlet.
    I have a date column in my database that stores the time and date together, but I do not know how to separate them into date and time fields. I also do not know how to concatenate them when a user inserts a new record, or how to query on a date alone.
    At present, the user has to type the date and time following this format mask hh:mi am DD/Mon/RR
    I also have a problem with one of my hidden id fields. I have set the default to a sequence.nextval (#qtc_app.seq_visitor.nextval) and then hidden it since
    it is irrelevant to my users. However, I can no longer use the query function since the sequence is always generating a new value. How would I only generate
    a new sequence no. when a user inserts a record??
    Thank you!
    cheers, Kim

    Hi,
    Each colunm in the form has a format mask associated with it. For the date column make the format mask like this DD-MON-RR HH.MI. This will show the date along with the hours and minutes.
    Thanks,
    Sharmila

  • How not to insert a Date/Time field on INSERT

    hi all, i have a MSAccess table which has a lot of fields one of which is a date/time field......
    when i run the SQL code to insert values into this table i want the date/time field to be left blank.....
    i have tried to insert a blank space using '' but it shows the error
    SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
    does anyone know how i can overcome this problem.....?

    that worked thanks a lot,
    the values are inserted into the database now but i still get an error
    SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
    but the values are inserted....a bit confused about that any reason why that would happen?

  • How to prevent user to enter data in "Date/Time Field"?

    Hi folks,
         Back after long time to the forums, where I get answers which are helpful in making me good at utilizing designer.
         I am trying to validate the "Date/Time Field" using JavaScript but couldn't get a proper RegEx expression for various invalid user input formats. If anyone can help me out in finding a proper script that would Great.
         My script grown bigger and bigger to accepting invalid dates, but felt like hardcoding. So, instead I decided why can't we prevent a user to enter data into "Date/Time Field" and use only calendar dropdown. Is there is a way to do this?
    find my sample testing docment
    https://acrobat.com/#d=mYXkrhO2txuEesCfmvxNXg
    Thanks in Advance,
    Rajesh

    Hi Rajesh,
    I don't think there is a way of stopping the user from using the keyboard to enter a date.  You can use the following script in the change event to stop them typing a date but they will still be able to paste a date in.
    if (xfa.event.change.length === 1)
    xfa.event.change = "";
    This code works because if the date is selected from the calendar dropdown then the date xfa.event.change value will be the whole date and therefore longer than one character.
    I couldn't access your sample but if you were to set an display picture for the date field to something other than date{YYYY-MM-DD} then a valid date will have a formattedValue that is different than the rawValue.
    Dave

  • Insert / Update of a TIME field using Native SQL

    Hi Oracle gurus,
    We are trying to perform inserts and updates within an ORACLE table where a TIME field exists without suscess. We are trying to code it using Native SQL.
    EXEC SQL.
    INSERT INTO table (field1[name], field2[age], field3[birthday], field4[hour])
    VALUES (:name, :age, TO_DATE(:date_birth), ¿:hour?)
    ENDEXEC.
    EXEC SQL.
    UPDATE table SET field3[birthday] = TO_DATE(:date_birth), field4[hour] = ¿:hour?
    WHERE field1[name] = :name AND field2[age] = :age
    ENDEXEC.
    Which is the right coding sentence in order to achieve our goal?
    Many thanks in advance. Best regards,
       Imanol

    Hi
    There is no TIME datatype in oracle. There is only a TIMESTAMP or DATE type or the field is VARCHAR2 as most date fields in a SAP database are. To help you we would need the real field type. If possible you please do a desc <owner>.<table> in a sqlplus session and give us the field type.
    If possible also supply the error you get.
    Regards, Michael

  • Need Purchase order entry time field

    Hi,
    I need to know the table and field of the purchase order created time.
    I found the purchase order creation date field(AEDAT)from EKKO Table. But unable to locate the time field. ( I need to put the timestamp logic). So, i require the time field.
    Waiting for ur answers....
    Regards,
    Rahul

    Hi ,
    Thank u for ur replies.
    I am using ME21N Transaction.
    My program extracts Open STO's(Stock Transport Orders) only.
    ( It doesn't pick up changed/delivered).
    It is scheduling hourly basis, So, My requirement is to put timestamp, so that we can extract Open STO's from last successful job run. For this i need time field,
    Is there any other option to achieve my requirement. If so, please let me know.
    In CDHDR table it is capturing changed order time, but i require creation time. So. I think that table i can't use..
    Waiting for ur answers...
    Thanks in advance.
    Regards,
    Rahul

  • Planned delivery time field in sale order

    Dear All,
    During creation of  STO at item level under delivery TAB "planned delivery time" field is showing with edit mode, I want to activate this field for sale order creation / change also. Plz advice how I can do this.
    regards,
    sps.

    Dear SP
    This field is laready there in the MRP-2 of the material master. This is used to calculate the no. of days to procure a material/service externally. Why do you want to activate this in sales order.
    Thanks
    Shuktiz

  • Date time field problem

    Hello there
    This maybe a simple problem but on the Date time field object i have input a display pattern and put the error message in. When I preview the PDF and populate the object with random text the pop up box will display my error message.
    What it does not do is clear the text I have input so the date can be re-entered correctly, which is what I was expecting. Therefore the user can continue on without addressing the date correctly.
    Can anyone advise what I should do to get this to work?
    Thanks
    Darren

    Hi
    The first time I thinkanyone has answered their own post. So for the benefit of anyone else I added the folowing script to the exit event
    of the date field object
    if (page.subform.dateobject.rawValue == page.subform.dateobject.formattedValue) {
    xfa.host.resetData("xfa.form.Formtitle.Page.subform.datefieldobject")
    Not sure why it works but just played around with it.

  • Time field also displaying current date

    Hi there
    I have two databound fields (to a Sybase back-end) - one is a date field, the other a time field!
    The date field works fine, but the time field is displaying the current date as well as the data retrieved time!
    The field is set to:-
    Data pattern: HH:MM::SS
    Data Format: Time
    Type: Date/Time Field
    Validation Pattern: HH:MM:SS
    The field is defined as 'time' in Sybase, and displays just the time in other objects (.NET fields...).
    Anyone any ideas?

    not the cleanest code, but i had this laying around in an old
    project...
    date = new Date()
    month = date.getMonth() + 1
    today = date.getDate()
    fyear = date.getFullYear()
    hours = date.getHours()
    minutes = date.getMinutes()
    seconds = date.getSeconds()
    if(month <10){
    month = "0"+month
    if(today<10){
    today = "0"+today
    if(hours <10){
    hours = "0"+hours
    if(minutes <10){
    minutes = "0"+minutes
    if(seconds <10){
    seconds = "0"+seconds
    CurrentTime.text = month+"/"+today+"/"+fyear+"
    "+hours+":"+minutes+":"+seconds

Maybe you are looking for