Can't convert date correctly

Hi, I have a date in the format ddddd, which represents the number of days since December 28,1800. I want to be able to convert this to a java date and also be able to convert back to this format.
I've tried calculating the offset and adding it to a date then dividing to get the number of days but it's always off.
An example would be 73107, as a java date (MMddyyyy) this would be 02/24/2001.
This seems like an easy problem to me but I just can't get it to work right.

Hi, one more note. The code above works perfectly for convering a clarion date to a java date but I modified it to do the reverse but I keep getting values that are not accurate. Here's the code I'm using (based on the code above):
      Calendar cal = Calendar.getInstance();
      cal.setTimeZone(TimeZone.getTimeZone("America/St_Johns"));
      cal.clear();
      cal.set(cal.YEAR,1800);
      cal.set(cal.MONTH,11);
      cal.set(cal.DATE,28);
      cal.set(cal.HOUR_OF_DAY,0);
      Date date = cal.getTime();
      long x = date.getTime();
      long baseMillis=x < 0 ? -x : x;
      System.out.println(String.valueOf(baseMillis));
      long aDay=24*60*60*1000L;
      long elapsedMillis = aDate.getTime(); //date parameter passed in
      long result = (elapsedMillis+baseMillis)/aDay;
      System.out.println(result);Feb 24,2001 should return 73107 but instead it returns 73135

Similar Messages

  • How can i convert data from DBF to oracle database 10g?

    Sir,
    How can i convert data from DBF to oracle database 10g?

    I assume you at least know how to dump the contents of foxpro dbf file into CSV format.
    Regarding SQL*Loader, hope this demo makes it a bit clear to you...
    http://www.princeton.edu/~storacle/sqlloader_demo.shtml
    I agree that it is an old web page (references Oracle 8.0.5) but basics remain the same.
    If it is still unclear to you after referring above link, then get an Oracle consultant.

  • I have a PDF in russian origin how can I convert it correctly?

    I have a PDF in russian origin how can I convert it correctly into MS word?

    Hello,
    which program do you use? For example "ExportPDF" has no Russian language options. Adobe Acrobat however can do it. In this case - if you don't have it at the moment - you should use the 30-day trial >>> see http://www.adobe.com/products/acrobat.html
    Hans-Günter
    P.S.
    A a detailed opinion with another point of view you will find there:
    How can I convert a Russian pdf file, using Adobe Acrobat XI Pro, to a Word document?

  • How can I convert date in FOX (from DEC to date[DEC])

    Hi everyone!
    In my planning layout I have a field called "MYDATE" of the date-type "DEC: Calculation or amount field with comma and +/- sign" (-> BPS does not allow using DATS as date-type).
    Since I import that date from a different system, I have to use a temporary workaround field "WADATE" (WorkaroundDate) of type DEC (alternatively integer or float) which contains the date in a format YYYYMMDD (e.g. 20070604).
    How can I transfer the date from WADATE to MYDATE? I tried using FOX, but for some reason it does not work. When I use the following function, MYDATE remains empty:
    DATA TMPDATE TYPE F.
    DATA MYPROJECTS TYPE B906_PROJ.
    FOREACH MYPROJECTS.
    "MYDATE" is the field I want my date in
    "WADATE" is my workaround field that contains the date
    TMPDATE = {WADATE,000,0000000001,0000000001,001}.
    BREAK-POINT.
    {MYDATE,000,0000000001,0000000001,001} = TMPDATE.
    ENDFOR.
    Is it possible to solve my problem with FOX? Or do I have to work with an EXIT function?
    Best regards, Daniel

    Daniel,
    The better approach is the one Marc said but if you have tomake a work around work, I think you might need to try and define your temporary date variable as String and another for the converted date as of type of the final date.  I would not define any date type as float unless you can have part days and it is very important to have part days, integer might work by I would try String first myself.
    It has been a while but on a BW 3.5 project I had to do some manipulation to read the attribute value of material master data to get the launch date and use it to derive the start period (definited as type 0FISCPER) and proportion of month based on number of days remaining after launch date vs the # of days for the month.  I think I used string type function in FOX to derive some of the component...
    Hope this helps,
    mary

  • How we can view convert data after XSLT mapping & before Graphical mapp

    Hello Friends,
    Currently i am working on XI standard content. In this client need some customization.
    In interface mapping, XSLT mapping on 1st position & Graphical mapping on 2nd position.
    As per my understanding 1st XSLT mapping will be exected then Graphical mapping.
    Can I see or check convert data from XSLT mapping.
    I want to check data between XSLT mapping & Graphical mapping.
    Kindly help me out.
    Regards,
    Narendra

    >
    Narendra GSTIT wrote:
    > I dont want to test standalone XSL Code.
    >
    > The data which I get from Source interface and after XSLT mapping I want to check this that my XSLT code is going well or not.
    >
    > i.e. check for proper input & get proper output.
    You have ro do standalone testing of the XSLT mapping.....Interface Mapping or Interface Determination will give you output message which will be that of message mapping (the last mapping)
    What is the issue in testing the XSLT mapping alone?...may be in Stylus Studio.
    Just ensure that XSLT mapping produces proper output and then this output message of XSLT is the input to your Message Mapping.....once the entire Interface mapping gets executed then it would mean that all the included mapping programs work fine.
    Regards,
    Abhishek.

  • After upgrading to iOS 8.2 can't update date (correctly (year stuck on 1970). This may be reason I can't get to app store.

    Hi,
    After upgrading to 8.2, I can't access the App Store. After troubleshooting and searching the web, I found suggestions to update the Time setting to automatic, then reset the network settings. The problem is, it won't completely set the Time and Date setting correctly, it is stuck on 1970 and I can't change it automatically or manually. As a result, I can neither downgrade to 8.1 nor upgrade to 8.3 nor update anything else.
    Any suggestions? It is a MD723LLA model (5th Gen, 32 GB with plenty of free RAM).
    Thanks,
    Scott

    Go to Settings>General>Date & Time and make sure calendar is set to Gregorian.
    Downgrading the iOS is not supported by Apple. Next would be to connect to your computer and restore via iTunes. The iPod will go to 8.3

  • How can I convert date infomation to a string just includes the date not th

    I just want the date like Thu 08, july 2004 but not the exact time.
    how can I do that.

    The prior code produces a date formatted as Jul 7, 2004
    To get Wed 07, July 2004, try this minor modification:
    import java.text.DateFormat;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    DateFormat format = new SimpleDateFormat("EEE dd, MMMM yyyy");
    Date mydate = new Date();
    String str = format.format(mydate);
    System.out.println(str);

  • Can I convert data inputted to Uppercase by using a EO/VO domain?

    I am running version 10.1.3.1.0.3984 of JDeveloper and Release 10.1.3.1.26 of JHeadStart. I am trying to mimic a feature that we used extensively in our previous tool so I'm not sure that it can be done this way, but was wondering if I can use an Entity Object or View Object Domain at the Model Layer as the method to convert certain Text Inputted values into Upper Case. I have searched these forums and have not seen it done this way and we are persuing utilizing an Oracle Trigger solution, but wanted to ask this question.
    When I create a Domain at the Entity Object Layer by selecting New --> Domain, I get the following code which is standard
    package its.sis.entities.UWDomains.common;
    import java.io.Serializable;
    import java.lang.Object;
    import oracle.jbo.JboException;
    import oracle.jbo.Transaction;
    import oracle.jbo.domain.DomainInterface;
    import oracle.jbo.domain.DomainOwnerInterface;
    // --- File generated by Oracle ADF Business Components Design Time.
    // --- Custom code may be added to this class.
    // --- Warning: Do not modify method signatures of generated methods.
    public class UWUpperDomain extends Object implements DomainInterface, Serializable {
    public UWUpperDomain(String val) {
    mData = new String(val);
    validate();
    private String mData;
    protected UWUpperDomain() {
    mData = "";
    public Object getData() {
    return mData();
    /**<b>Internal:</b> <em>Applications should not use this method.</em>
    public void setContext(DomainOwnerInterface owner, Transaction trans,
    Object obj) {
    /**Implements domain validation logic and throws a JboException on error.
    protected void validate() {
    // ### Implement custom domain validation logic here. ###
    public String toString() {
    if (mData != null) {
    return mData.toString();
    return "<null>";
    public boolean equals(Object obj) {
    if (obj instanceof DomainInterface) {
    if (mData != null) {
    return mData.equals(((DomainInterface)obj).getData());
    return ((DomainInterface)obj).getData() == null;
    return false;
    I, in my limited Java knowledge (very limited) tried to customize this code with the following highlighted change
    public Object getData() {
    return mData.toUpperCase();
    This did not produce the results I had hoped for i.e. everytime that any Entity Object is defined with this domain, that whatever is typed into it is converted to Upper Case.
    Is this possible with this type of domain? I'd appreciate any input/clarification.
    Thanks very much
    Mary
    University of Windsor

    package its.sis.entities.UWDomains.common;
    import java.io.Serializable;
    import java.lang.Object;
    import oracle.jbo.JboException;
    import oracle.jbo.Transaction;
    import oracle.jbo.domain.DomainInterface;
    import oracle.jbo.domain.DomainOwnerInterface;
    // --- File generated by Oracle ADF Business Components Design Time.
    // --- Custom code may be added to this class.
    // --- Warning: Do not modify method signatures of generated methods.
    public class UWUpperDomain extends Object implements DomainInterface, Serializable {
    public UWUpperDomain(String val) {
    mData = new String(val);
    validate();
    private String mData;
    protected UWUpperDomain() {
    mData = "";
    public Object getData() {
    return mData.toUpperCase();
    /**<b>Internal:</b> <em>Applications should not use this method.</em>
    public void setContext(DomainOwnerInterface owner, Transaction trans,
    Object obj) {
    /**Implements domain validation logic and throws a JboException on error.
    protected void validate() {
    // ### Implement custom domain validation logic here. ###
    public String toString() {
    if (mData != null) {
    return mData.toString();
    return "<null>";
    public boolean equals(Object obj) {
    if (obj instanceof DomainInterface) {
    if (mData != null) {
    return mData.equals(((DomainInterface)obj).getData());
    return ((DomainInterface)obj).getData() == null;
    return false;
    }

  • How can i convert a data file to mp3 so it can be played ?

    HOW CAN I CONVERT DATA FILE TO MP3

    You cant change a file on a CD/DVD.
    You need to import the contents to iTunes. You can choose the file format to save it as in iTunes Preferences.
    From the menu bar (with iTunes open)
    iTunes > Preferences > General - click the Import Settings button and change the choice to mp3 encoder.
    (Note - that instruction is for iTunes 9.1.1 - if it's changed in 10.x, I trust Klaus or one of the others will correct me).
    When you've set the import encoding, put your CD in and select import (button at bottom right in 9.1, may be in the menu bar for 10.x).

  • Question about get web service result in actionscript and convert data format

    Hi, All
    I have question about how to get dataset from web services
    and put it in tree structure. I have 2 questions about this:
    1, How can I get data correctly in actionscript?
    I have no problem to get data by
    <mx:ArrayCollection id="acFolder"
    source="{mx.utils.ArrayUtil.toArray(MyGServices.getFolder.lastResult)}"
    />
    And display in datagrid.
    But when I try to use
    public function
    handleFolderContents(event:mx.rpc.events.ResultEvent):void{
    arData=mx.utils.ArrayUtil.toArray(event.result);
    acData=new ArrayCollection(arData);
    input.text=acData.getItemAt(0).id;
    Seems I can’t get data, it always say:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    2, how to convert data format
    I get data from web service and want to convert it to tree
    structure, as mention below:
    I get:
    <Array>
    <id>111</id>
    <Name>Production1</Name>
    </Array>
    <Array>
    <id>222</id>
    <Name>Production2</Name>
    </Array>
    Convert to:
    <mx:XMLList id="treeData">
    <node>
    <node label="Production1" data="111">
    <node label="Production2" data="222"/>
    </node>
    </node>
    </mx:XMLList>
    Please help me.
    Thanks.

    First, don't specify the package path in the argument
    declaration. Instead import the event object:
    import mx.rpc.events.ResultEvent;
    The docs state this emphatically.
    Second, try "lastResult", in place of "result":
    arData=mx.utils.ArrayUtil.toArray(event.lastResult); // I am
    not positive about this. I maybe recall reading that result was ok
    for the event object, but maybe not.
    Finally, why do you want to convert the xml? You certainly
    could, but it would be a manual process, recursively reading the
    existing xml nodes and building the new structure, but again, why?
    Just use a labelFunction if necessary to display the nodes as
    you wish.
    Tracy

  • CMI adapater can't send data to ilearning

    our courseware can send the data correctly to ilearning in development platform (content server and ilearning are in the same box) but could not send the data to ilearning in the staging platform (content server and ilearning server are in different server box) . here is the copy of lines in my imsmanifest.xml file.
    <?xml version="1.0" encoding="utf-8"?>
    <manifest identifier="PingAnHistory2" version="1.0" xmlns="http://www.imsproject.org/xsd/imscp_rootv1p1p2" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_rootv1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsproject.org/xsd/imscp_rootv1p1p2 http://ilearna.user.com/ilearn/en/admin/dtd/imscp_rootv1p1p2.xsd http://www.imsglobal.org/xsd/imsmd_rootv1p2p1 http://ilearna.user.com/ilearn/en/admin/dtd/imsmd_rootv1p2p1.xsd http://www.adlnet.org/xsd/adlcp_rootv1p2 http://ilearna.user.com/ilearn/en/admin/dtd/adlcp_rootv1p2.xsd">
         <metadata>
              <schema>ADL SCORM</schema>
              <schemaversion>1.2</schemaversion>
              <lom xmlns="http://www.imsglobal.org/xsd/imsmd_rootv1p2p1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://www.imsglobal.org/xsd/imsmd_rootv1p2p1 imsmd_rootv1p2p1.xsd">
                   <general>

    Course metadata has nothing to do with tracking.
    1. Ensure the RCO tracking type is set to CMI
    2. Are the CMI adapter files loaded on the content server in a public directory?
    3. Is the CMI Adapter registered properly in iLearning (Site -> More -> CMI Adapters)
    Scott Morris
    Seertech Solutions
    http://www.seertechsolutions.com

  • Problem with converting data types

    Hi Experts,
    I am stuck up with a little problem, i need your help
    i am converting all the data types to CHAR but i am not getting the expected data out.........
    My code is as below...where do i go wrong...
    LOOP AT <T_ITAB> ASSIGNING <FIELD>.
    DO.
       ASSIGN COMPONENT SY-INDEX OF STRUCTURE <FIELD> TO <RECORD>.
       IF SY-SUBRC = 0.
          LV_FIELD = <RECORD>.
          N = STRLEN( LV_FIELD ).
          IF N = '8'.
               IF LV_FIELD IS NOT INITIAL.
                      LV_DATE = LV_FIELD.
                      CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
                              EXPORTING
                              DATE                     = LV_DATE
                             EXCEPTIONS
                                    PLAUSIBILITY_CHECK_FAILED = 1
                                    OTHERS                     = 2.
                             IF SY-SUBRC <> 0.
                                     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                             ENDIF.
                         IF SY-SUBRC EQ 0.
                            CONCATENATE LV_FIELD+6(2) LV_FIELD+4(2) LV_FIELD+0(4) INTO LV_FIELD SEPARATED BY '.'.
                        ENDIF.
                ENDIF.
             ENDIF.
                IF LV_RECORD IS INITIAL.
                         LV_RECORD = LV_FIELD.
                ELSE.
                       CONCATENATE LV_RECORD LV_FIELD INTO LV_RECORD SEPARATED BY '  * '.
               ENDIF.
           ELSE.
         EXIT." DO
        ENDIF.
       ENDDO.
      APPEND LV_RECORD TO LT_OUTPUT.
    CLEAR LV_RECORD.
    ENDLOOP.
    THE TABLE LT_OUTPUT     LIKE     THENV(CHAR 255)
    My output looks some thing like this:
    04  36876   15.09.2011  39600   1999
    06  36960   15.09.2011  39600   2632
    07  36874   15.09.2011  39541   9232
    My expected output
    04    36.876  15.09.2011    39.600  1.999
    06    36.960  15.09.2011    39.600  2.632
    07    36.874  15.09.2011    39.541  9.232
    Regards
    sam

    At run time you can see all the data........ like what i have shown...
    but if you clearly see, DATE will be in the internal format..but if you print it, it will be in dd:mm:yyyy
    can you suggest me if i have a dynamic field symbol (table data) ,,,, How can i convert data types dynamically..
    if it is a static internal table i am achieving with WRITE TO statement.....but i have huge data in field symbols...
    Instead of all these , please specify the exact problem your are facing . What is it with date field ? . In SAP while printing the internal format will be converted to external. What is your requirement with this date field?
    My output looks some thing like this:
    04 36876 15.09.2011 39600 1999
    06 36960 15.09.2011 39600 2632
    07 36874 15.09.2011 39541 9232
    My expected output
    04 36.876 15.09.2011 39.600 1.999
    06 36.960 15.09.2011 39.600 2.632
    07 36.874 15.09.2011 39.541 9.232
    I dont see any problems mentioned in your date field. Both your actual and expected outputs reflects the same in date field.
    In SCN you will only get solutions if your question is precise.
    Kesav

  • How can I convert output data (string?) from GPIB-read to an 1D array?

    Hello all,
    I am reading a displayed waveform from my Tektronix Oscilloscope (TDS3032) via the GPIB Read VI. The format of the waveform data is: positive integer data-point representation with the most significant byte transferred first (2 bytes per data point).
    The output data of GPIB-Read looks like a string(?) where the integer numbers and a sign like the euro-currency sign are seperated by spaces e.g. #5200004C3 4 4 4 4 3C3C3........ (C represents the euro-currency sign).
    How can I convert this waveform data into a 1D/2D array of real double floatingpoint numbers (DBL) so I can handle the waveform data for data-analysis?
    It would be very nice if someone know the solution for this.
    t
    hanks

    Hi,
    First of all, I'm assuming you are using LabVIEW.
    The first you need to do is parse the string returned by the instrument. In this case you need to search for the known symbols in the string (like the euro sign) and chop the string to get the numeric strings. Here are some examples on parsing from www.ni.com:
    Keyword Search: parsing
    Once you parse the numeric strings you can use the "String/number conversion VIs" in the String pallette.
    Hope this helps.
    DiegoF.Message Edited by Molly K on 02-18-2005 11:01 PM

  • How can i convert the firefox-history-timestamp in places.sqlite into a normal date format? The firefox-timestamp is not equivalent to the unix-timestamp, that's why I ask. I could not find a conversion function. Does anyone know something about this?

    As I opened the places.sqlite with an sqlite-editor I found out that firefox saves the last_visit_date via a timestamp which is 16 digits long. I realized that the first 10 digits are similar to the corresponding unix-timestamp but not equal. So.. how can i convert the firefox-timestamp into a normal date? Or into the corresponding unix-timestamp?

    Write a bash script or 'C' program to change the date format and then use the sql update function to receive the stdio output 'where date_field='embeded date value'.

  • How can I convert a space from ABAP to CSV data?

    Hello guys,
    how can I convert a string like
    "This is a%test%"
    to
    "This is  a test "
    into CSV data?
    I try to with   REPLACE ALL OCCURRENCES OF '%' IN string_above WITH space,
    but I got the string without space, like
    "This is  atest"
    I read some posts that CSV will ignore space.
    But which kind of symbol in CSV represents space?
    Thanks for any suggestion!
    Regards,
    Liying

    USE THE CODE AS SHOWN BELOW...
    TYPES : BEGIN OF tp_data,
              line(4096),
            END   OF tp_data.
    *&      Form  gui_upload
          Upload the data from the input file to the internal table
    FORM gui_upload.
    *--Local data declaration
      DATA: l_filename_ip TYPE string,
            tl_data       TYPE STANDARD TABLE OF tp_data WITH HEADER LINE.
      l_filename_ip = p_input.
    *--Upload Data
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                filename                = l_filename_ip
                filetype                = 'ASC'
                has_field_separator     = ''
           TABLES
                data_tab                = tl_data
           EXCEPTIONS
                file_open_error         = 1
                file_read_error         = 2
                no_batch                = 3
                gui_refuse_filetransfer = 4
                invalid_type            = 5
                no_authority            = 6
                unknown_error           = 7
                bad_data_format         = 8
                header_not_allowed      = 9
                separator_not_allowed   = 10
                header_too_long         = 11
                unknown_dp_error        = 12
                access_denied           = 13
                dp_out_of_memory        = 14
                disk_full               = 15
                dp_timeout              = 16
                OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE ID   sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        IF sy-subrc = 1.
          MESSAGE e000 WITH text-e04.
        ENDIF.
      ELSE.
        LOOP AT tl_data FROM 2.
    *--Taking the contents of the input file leaving the header part
          PERFORM split_and_save USING tl_data-line.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " gui_upload
    *&      Form  split_and_save
          Splitting the contents from the input file and saving them into
          an internal table
         -->P_TL_DATA_LINE  text
    FORM split_and_save USING fp_data.
    *--Local data declaration
      DATA : tl_data TYPE STANDARD TABLE OF tp_data WITH HEADER LINE,
             l_type  TYPE c,
             c_space(1) TYPE c VALUE ' '.
    *--Split at the Comma
      SPLIT fp_data AT c_space INTO TABLE tl_data.
      CLEAR inputtab.
    *--Move it to the target fields
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE inputtab TO <fs_field>.
        IF NOT sy-subrc IS INITIAL.
          EXIT.
        ENDIF.
    *--Extract source data
        CLEAR tl_data.
        READ TABLE tl_data INDEX sy-index.
    *--Populate the target
        <fs_field> = tl_data-line.
      ENDDO.
    *--Append this record
      APPEND inputtab.
    ENDFORM.                    " split_and_save
    In the above code u can use make inputtab like tp_data and get the result as requires in an internal table as space seperated fields.
    In place of space u can also use any other symbol.
    And after that u can replace all occurences of space with the comma by using the statement that u have written below.

Maybe you are looking for

  • Can't open a saved interactive form

    I have developed an interactive form using ABAP WebDynpro. While I have the form displayed (with or without having filled in any values), I use the "save" button on the standard Adobe toolbar (i.e. not anything I programmed myself) to save the form t

  • Listbox in screen painter

    Hello Friends, which is the better way to fill the values in the list box either by POV or set_vrm_values?? how to select multiple values from listbox ?? how to pass these values in the table control?? Pls suggest/comment Regards, Sunny

  • Update retriever not always latest driver

    I have noticed lately that Update Retriever is not pulling the latest driver from the Lenovo website. I specifically noticed this with the query 3437/win8 updates. It doesn't pull the RealTek High Definition Audio Driver version 6.0.1.7040.  Is there

  • File Reader that can read line by line contents

    Hi there! I would like to ask how to read the content of a file line by line... I need to convert all the contents of a text file into html file. Example: 3890001604AM0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS. 3890003011

  • Set New Code for Network ???

    I seem to have forgot my Wireless file sharing password and was hoping someone knows how to reset it or what happens when you reach ten attempts because I know I can eventually remember it but not sure with four more chances, tries, etc.  The help pa