Date.getTime() with very early Dates

Hi,
I has a problem with Date.getTime(). If I want the milliseconds from an very early date (like 01.01.1970 00:01:00) I get an negative value from Date.getTime() (in this case -354000). I need this because I want to add a short time (not really date) to a date.
I has played with different Timezone settings but this doesnt help.
Has anyone an idea?
Thank you.
Bye

Hmmm, I spotted that there was something wierd like this a few days ago. Consider the following:
import java.text.*;
import java.util.*;
public class Test {
    public static void main(String[] argv)
            throws Exception {
        String dateFormat = "dd.MM.yyyy HH:mm:ss";
        String dateString = "01.01.1970 00:00:00";
        DateFormat df = new SimpleDateFormat(dateFormat);
        Date date = df.parse(dateString);
        System.out.println(date);
        System.out.println(DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(date));
        System.out.println(date.getTime());      
        System.out.println();
        Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
        cal.setTime(date);
        System.out.println(cal.getTime());
        System.out.println(cal.getTimeInMillis());
        System.out.println();
        Date date2 = new Date(0);
        System.out.println(date2);
        System.out.println(date2.getTime());             
}The output is:
Thu Jan 01 00:00:00 GMT 1970
01 January 1970 00:00:00 GMT
-3600000
Thu Jan 01 00:00:00 GMT 1970
-3600000
Thu Jan 01 01:00:00 GMT 1970
0I get the same results using both IBM and Sun JVMs.
Any ideas?

Similar Messages

  • I am receiving bills from my carrier with very high data usage. I read books from apple store. Do ibooks use gb once purchased?

    I am receiving bills from my carrier with very high data usage. I read books from apple store. Do ibooks use gb once purchased?

    To reduce data usage, you should put iPad on Aeroplane Mode to stop all background activities when not using iPad.
    Message was edited by: Diavonex

  • HT1338 I have macbook without a firewire port, I have usb 2.0 port, now my os is not working I can not get through apple logo loading , I can not enter safe mode, I can only enter one user mode, how can I backup my data, I have very important data in my h

    I have macbook without a firewire port, I have usb 2.0 port, now my os is not working I can not get through apple logo loading , I can not enter safe mode, I can only enter one user mode, how can I backup my data, I have very important data in my hdd

    Here is what worked for me:
      My usb hub, being usb2, was too fast. I moved the wire to a usb port directory on my pc. That is a usb1 port which is slow enough to run your snyc.

  • Asset master data synchronization with HR Master data

    Dear Experts:
                          I am FI consultant and i am doing Research on Synchronization of asset master data with HR master data. Our management wants that if company gives any thing which is regarded as an asset e.g Laptop, expensive tools e.t.c to its employee then beside opening its asset master data in FI it should also be updated in HR Employee master data. For this from FI side there are 3 asset classes for which we want that if any asset is opened in these classes then the data should be updated in HR. I have turned on Personnel number in screen layouts and have fetched this field in asset reports. We want
    1...Asset Description
    2...Cost Center
    to be updated in HR master data. Now my question is that how this can be achieved. Is it possible? What configuration will need to be done for it.
    Regards

    Hi
    FOr assets created in FI and reflect them in HR use the feature ANLAC and it will take care.
    This feature determines whether or not the system checks the fields Asset number in infotype 0040 (Internal Control) and Loan object number  in infotype 0040 (Objects on Loan) against database ANLA.
    R K

  • Generic Data Source with Function Module data mismatch in BI

    Hi All,
    I'm using Generic Data Source with Function Module, When I execute the Function Module (Which I have Created), I'm getting 16000 records and when run extractor(in RSA3) im getting different no.of records(infact they are more no.).
    when I run the InfoPackage in BI im Getting more no. of records than what i got executing the function module..
    and single record is divided into 2 records in BI side(not all the records), how can it be possible???
    is there anything Im missing to explain you my issue???
    if understood please help me out.
    Thanks n Regards,
    ravi.

    the datasource frame work starts the function module several times.
    1. the initialization
    2. the serval times, until you "raise no_more_data".
    check you coding: have you refreshed necessary internal tables.
    Sven

  • Generic Data Source with Function Module data mismatch

    Hi All,
    I'm using Generic Data Source with Function Module, When I execute the Function Module (Which I have Created), I'm getting 16000 records and when run extractor(in RSA3) im getting different no.of records(infact they are more no.).
    when I run the InfoPackage  in BI im Getting more no. of records than what i got executing the function module..
    and single record is divided into 2 records in BI side(not all the records), how can it be possible???
    is there anything Im missing to explain you my issue???
    if understood please help me out.
    Thanks n Regards,
    ravi.

    HI rkiranbi,
    1. FIrst you excute function module according to your paramers, you will get some records. then goto tcode RSA3 --> excute
    Provide your Data source name and under setting we have options like Data records/calls, Display extractor calls and selections --> fields .
    in that options you have to increase the values. and then you have to pass paramers in RSA3 according to your function module
    selections in SE37. Now you will get equal values in both functin module selection and RSA3 Selection. if it fail means  you need to
    check coding logic in function module. 
    2. if your  are getting wrong values in BI System then check with
                  1. compare with PSA data and data target data (here you need to check with characterstic as well as keyfigures)
                  if you find any mistake you need change the coding in function module according to client requirement.
                  2. compare data with RSA3 and bi report data or data target data.
                                 check it properly above steps, you will get solution.
    thanks and regards,
    malli

  • Possible to export Tuple data along with main table data in Excel sheet?

    Hi Expert,
    Wondering is it possible to export tuple table data from data manager along with main table data?
    Regards,
    Rajeev

    Rajeev,
    I am afraid that functionality of exporting tuples data using data manager is not available at the moment till MDM 7.1 SP08. Lets see if coming versions provides this functionality...
    - Shiv

  • IWeb blog entry with an earlier date than today?

    Is there a way to create an entry in iWeb that has a date before today's date? Say I want to create an entry of something that happened five days ago... When I create an entry, it automatically sets the date to today. Is there any way to change the date backwards for the entry?

    Possibly not. When you highlight and erase it, it doesn't help you make a new one, but the font size and color settings remain. I just re-wrote the dates I wanted in the same way they had already been written (day, month, date, year).
    Example on my non-profit site, all the journal entries were entered on the same day (Jan 25), but I changed the dates on them to reflect when they were actually written by the author. See under "Journal" page in this site linked here: http://www.catalinafoundation.org

  • FI master data integration with hr master data

    Dear Xperts i had an issue regarding integration of FI and HR Master Data.in pe03 i changed the feature ANLAC by Replacing N with Y because of this the integration get ON but the issue is that whenever our FI consultant assign asset to any personal number say for example Personnel number 1.then if i create it40 for personnel number 2 that asset which is assigned to personel number 1 is displaying in it40 in asset fiel of personal number 2 but we assigned to 1 not to 2 what will be the problem could u please help me in this regard

    Dear Experts.
    Say for e.g i assign two different assets to two different personal numbers e.g asset no 14000235 to pernr no 1 and asset no 14000236 to pernr no2 but when i maintian them in pa30 in infotype40 if firslty before mainting asset no for 1 i maintian it for pernr no 2 it is displaying asset no 14000235 which is for pernr no 1 not for pernr no 2 is their any way that respective asset number should come in personal to whom i assigned in FI
    Regards

  • BW Data Reconsolidation with R/3 data

    Hi Experts,
    I need to know the standard data reconsolidation process generally followed in BI. Currently we have BI7.0 and data from R/3 so we need to have data reconsolidation process.
    Please suggest the efficient process to have the data consolidated. Your recommendation would be appreciated.
    Thanks

    Hi VJ,
    There is as such no standard data reconciliation process. However you can make your own customized way of doing the reconciliation with R/3.
    I will give you a scenario to help you understand it better. Lets say BW extracts FI data from R/3. To make sure that all the records has been extracted from R/3 we can create a report in R/3 which will show the year-to-date balance of all the documents posted and we can create a BEx query on the BW cube which will also display the trial balnce. Any difference between the two balance will identify the records missing from R/3.
    Similary you can model other scenarios as per your requirement. If you are extracting from 2 or more different sources from R/3 then create a multicube on top of the individual cube and produce the report. You need to also create a similar report in R/3 as well.
    Hope it helps.
    Thanks,
    Soumya

  • Sales order Request delivery date map with PO delivery date

    Hi
    I have an requirement. While run the MRP to create PR from Sales order.
    We need take the delivery date in the sales order to PO delivery date. How to configure
    Pl advice
    Regards,
    Kumar

    Check with your SD/LE functional specialist on whether this can be configured.  Alternatively, you might insert a specific future date and update when the delivery date is known...Generally, however, one expects that someone wanting to buy something from us has a delivery date in mind...whether we agree to that date or can promise to deliver on that date is a different matter....

  • Alert on Today's Data Compared with Previous Day Data

    Hi All,
    I've a report with multiple tabs having data like,
    Tab:1                                   Tab:2                                 Tab:3                          Tab:4
    Franchise: ABC                   Franchise                          Franchise                    Same as Tab:3
    Start Date:                           Start Date                          Month
    Operator: XYZ                     Operator                            Operator
    Incoming Node:N01            Outgoing Node                  Incoming Node
    Incoming Path:P01             Outgoing Path                    Incoming Path
    Incoming Count:2                Outgoing Count                 Incoming Count
    Incoming Mins: 10.63          Outgoing Mins                   Incoming Mins
    My requirement here is, I've want an alert on Percentage of Mins comparing its data with the previous day(Month for Tab 3 & 4) mins data. For now I've done this by creating a variable(with Relative Value Function) that stores the previous day or month's mins and stored the difference of these two data into another variable as Variation. I've put a percentage on the Variation variable and put a alert on it. It went well till here but, my requirement also has graphical alert on percentage. I tried adding the Variation variable and percentage and all available measures. But an error showed up with every try saying "Error in dataset values :#COMPUTATION"
    Is there any other to do this report?
    Note: I'm using WebI Rich Client v4.1 SP1

    I tried using Franchise(Dim) and with that i've used Incoming Count, Incoming Mins, Variation separately. But nothing worked.

  • Data binding with tableview: no data returned...

    Hi,
    I looked at the example BSP_MODEL and now I am trying to build a simple test application with a tableview.
    I can easily display data from my model in the tableview, but I can't get the modified data back to my model.
    I have implemented the method DO_HANDLE_DATA in the table's controller with the following code:<i>
      CALL METHOD super->do_handle_data
        EXPORTING
          form_fields     = form_fields
          global_messages = global_messages.</i>
    The DO_INIT method is like this:
    <i>m_model ?= create_model( model_id = 'm'
                             class_name = 'ZNP5' ).
    if m_model is bound.
      m_model->init( ).     "a simple select on SFLIGHT
    endif.</i>
    Obviously I missed something, any idea?
    Thanks for your help.
    Nicolas

    Hi Richard,
    Here are more details on my test application:
    Model:
    - Class Name: ZNP5, superclass: CL_BSP_MODEL
    - Attributes: FLIGHTS, Public, TYPE FLIGHTTAB
    - Method INIT, Public:
      SELECT * FROM sflight INTO TABLE flights.
    The BSP Applications consists of a main controller (main.do) and a subcontroller (table.do) calling views main.htm and table.htm.
    MAIN.DO:
    - DO_INIT method
      DATA: subc1 TYPE REF TO cl_bsp_controller2.
      subc1 ?=  create_controller( controller_name = 'table.do'
                                   controller_id   = 'subc1' ).
    - DO_REQUEST method
      DATA: view TYPE REF TO if_bsp_page.
      dispatch_input( ).
      view ?= create_view( view_name = 'main.htm' ).
      call_view( view ).
    TABLE .DO
    - Attributes: M_MODEL, Private, Type Ref To ZNP5
    - DO_INIT method
      m_model ?= create_model( model_id = 'm'
                               class_name = 'ZNP5' ).
      if m_model is bound.
        m_model->init( ).
      Endif.
    - DO_REQUEST method
      DATA: view TYPE REF TO if_bsp_page.
      view ?= create_view( view_name = 'table.htm' ).
      view->set_attribute( name = 'model' value = m_model ).
      call_view( view ).
    - DO_HANDLE_DATA method
      CALL METHOD super->do_handle_data
        EXPORTING
          form_fields     = form_fields
          global_messages = global_messages.
    main.htm
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <%@extension name="xhtmlb" prefix="xhtmlb" %>
    <%@extension name="bsp" prefix="bsp" %>
    <htmlb:content design="design2003" >
      <htmlb:page title=" " >
        <htmlb:form>
          <bsp:call comp_id="subc1" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    table.htm
    Attributes: model Type ref to ZNP5
                SelectedRow type string
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:tableView id               = "tvX"
                     headerText       = "Connections"
                     width            = "100"
                     headerVisible    = "true"
                     design           = "alternating"
                     visibleRowCount  = "8"
                     fillUpEmptyRows  = "true"
                     showNoMatchText  = "true"
                     filter           = "server"
                     sort             = "server"
                     onHeaderClick    = "MyEventHeaderClick"
                     onRowSelection   = "MyEventRowSelection"
                     selectionMode    = "LINEEDIT"
                     selectedRowIndex = "<%= selectedRow %>"
                     table            = "//model/flights"
                     tabIndexCell     = "true" />
    I've just discovered that the data is actually transfered to the model but it's not retained: When I edit the 1st line of the table, the modified values are transfered to the model, but if I edit the 2nd line, I loose the previous changes... How to solve this?
    Regards,
    Nicolas

  • CS5 compatibility with very early versions ie DW4

    Hi,
    I've just got my own copy of CS5 and going to college part-time to get to know it. I've used DW8, in a small way, at work (a school).
    If I use CS5 (at home) on a site developed at work in DW8 will it be compatible? Any problems when amending/updateing a page created in CS5 but updated at work in DW8?
    I've also been asked to create a site for another school who still have DW4. Any likely problems there? (The new site will be updated in future in school by a staff member familiar with the original DW4 software so they are reluctant to upgrade to CS5).
    I assume all will be OK but want to check at this stage!
    Thanks for any help!

    If I use CS5 (at home) on a site developed at work in DW8 will it be compatible? Any problems when amending/updateing a page created in CS5 but updated at work in DW8?
    You should be fine.
    I've also been asked to create a site for another school who still have DW4. Any likely problems there?
    Yes, definitely - template syntax changed completely going from DW4 to DMX (version 6).  A template or child page built in CS5 will NOT BE RECOGNIZED as a template or child page in DW4. And DW4 had very little if any UI for managing CSS.  Honestly unless you are building a very simple site, I wouldn't touch this job.

  • Date format with cfinput validate="date"

    SSBuZW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SBuYW1lIG9mIGEg
    ZnVuY3Rpb24gDQoNCg0K

Maybe you are looking for

  • My Macbook pro iPhoto is gone!!

    My Macbook pro has been running very slow and today i found out that my iPhoto is gone! I have checked my purchased items and iPhoto is not listed there! What I meant to do?! What is the problem?

  • Credit control on distribution channel  wise

    hello can anyone tell me how to have credit control on distribution channel  wise i know sales area assignment to credit control area but can we have a direct way of controlling credit can three be any way

  • Removing Background Grid Lines on Chart

    How do you do that?

  • Pan/Zoom - activation delay on iPad Content Viewer

    I am able to create an image/frame and turn on PAN & ZOOM in the Interactive Overlays panel. However, when I preview it on my iPad...it is difficult to activate the pan/zoom interactivity: It seems I have to tap the image once, then wait about 4-5 se

  • Jitter in Voice Network

    Dears; i have attached network design and it is working but i face Delay variations on the Routers at both sites FYI: R0 is connected to R4 through two Satellite links with delay around 600-900 ms and one link to R3 through satellite link with same d