Not urgent time difference  and duration  1970 is annoying me

hello
I have been trying to calculate the duration between t0 and now .I have tried everything
but I'm having one hour more .
here is the last test I have done
SimpleDateFormat df=new SimpleDateFormat("hh:mm:ss");
String arriving;
String now;
Date d1,d2;
      try
         arriving="10:15:20";
         now="10:30:20";
         d1 = df.parse(arriving);
          d2=df.parse(now);
      } catch (ParseException ex)
         ex.printStackTrace();
Date dd = new Date(d2.getTime() -d1.getTime());
System.out.println("duration   dd   is "+ dd);here is the result i get
Thu Jan 01 *01*:15:00 CET 1970
normaly I need to have Thu Jan 01 *00*:15:00 CET 1970
thank you in advance
ps:I have tried better or other ways ,but I get always this one "1" before

linuxchild wrote:
I have added this ,and now I get red of the 1 ,but could any one confirm me if this will work on the winter time also ????
Date dd = new Date(d2.getTime() -d1.getTime() --(3600000 ));
This will only work for computers in your time zone, since you are hardcoding the offset.
Instead, I encourage you to use the same time zone for all of your computations so you don't have to deal with it.
You should be able to pass the time zone as an argument to the date strings that are being parsed.
Edit: warnerja beat me to it.
Edited by: Jin on Oct 16, 2007 11:19 AM

Similar Messages

  • My document.numbers can not be opened how can i recover the version from yesterday i was not using time machine and it was not in icloud. is there an app i can buy that might help

    my document.numbers can not be opened how can i recover the version from yesterday? i was not using time machine and it was not in icloud. is there an app i can buy that might help

    Thanks Andy,
    I wish I could have told my sister about this as she could not open my homepage back before my new iWeb site. She now can open my site without the yet in case denial window does appear = I thank you.
    I think my iWeb site works as Noone has said otherwise from any platform etc...
    Alex L
    I do agree that should not have to be a consideration for any users so i agree that it would be great if Apple could allow simplicity to run seemlessly.
    I have had this problem since Homepage, and here is
    what has worked for me. I send out the link, and
    then for PC users I send the link with "<" after the address (without quotation
    marks. e.g., <http://site.com>).
    I also put a note that if that doesn't work, to just
    copy and paste the link into a browser. With that I
    have only had 1 person say they still can't open.
    Everyone else gets it to work.
    It's a lot to do and seems like a hassle, but you get
    used to it.
    Hope this helps!
    Andy Martini
    PS - APPLE! When are you going to fix this??! It
    seems like such a small thing yet you guys have been
    stumped for YEARS on this!

  • Help with new Airport Extreme (and network name) not recognizing Time Capsule and other Airports in the home

    I had a Time Capsule running in an AV Cabinet and it made too much noise as it backed up and ruined soft/quiet music passages (and created far too much warmth as well).  So, I visited the local Apple store and the guy I met worked through a few solutions with me.  I decided on an Airport Extreme for the audio cabinet, and would move the Time Capsule to another room where it would not create noise interference.
    So, I have the Airport up and running perfectly well.  I changed my wireless network name and password.
    I cannot get the Airport Express and Time Capsule to show up on my network.  They both just blink that brown/orange color on the front.  When I go to the Airport Utility, it does not pick up the Time Capsule or Airport Express.  I have tried unplugging and plugging back in and scanning for devices, but dont know what else to do.  Are they still looking for my old network?  Is there a way to reset them??
    Thanks for any help.

    I've tried the option key on both--the AEBS offers 14 options, including Automatic, while the TC offers 8 options, and no Automatic. The AEBS lists (among others) 802.11 a/n-b/g compatible, 802.11 a-b/g compatible, or 802.11 n (5 GHz)-b/g compatible. The TC offers 802.11.n (b/g compatible), 802.11n only (2.4 GHz), and 802.11n only (5 GHz), among others...
    I had already followed the instructions in the link you supplied, except that the wireless options don't quite match...
    I am currently trying 802.11n (5GHz)-b/g compatible on the AEBS and 802.11 (5GHz) on the TC, which gives me a rate of 270 on my n devices and 54 on my g devices, according to the Airport Utility.
    This might be the best I can do, without buying a new TC. Thanks for any advice you can give...
    C.

  • Capturing system time and date and the time difference and date difference.

    Hello Experts,
    i have a requirement the i need to capture select query start time and date as i runthe program on midnight (ie) 11:55 p.m.
    I tried system fields sy-datum and sy-uzeit for capturing the system date and time when my program runs but it gets reset when the date changes.
    i tried get time field option but it is resetting the sy-datum to zero so i am able to capture the date of the next day and resulting in wrong calculation of time .
    please help with your valuable answers.
    Thank you,
    Srinivas.

    Hi,
    As per my understanding you want to fetch those data which are created between the program last run date time and current date time.
    If I am right please follow the below procedure.
    1. Create one custom table to store program name and program execution last date time
    2. at event INITIALIZATION populate to fields date and Time using the statement sy-datum
    initialization.
      v_curr_time = sy-uzeit.           " Current time
      v_curr_date = sy-datum.           " Current date
    3. Get the last run date and time from the above custom table.
    4. Do your logic.
    5. at last Update the custom table with current date and time based on the step two (Here do not take sy-datum like that, take the value in the global variable populated in step 2)
    Thanks
    Subhankar

  • Standard function for returninf time difference in days and hours.

    Hello all,
                Can somebody tell me whether there exists some standard function module which can calculate the time difference and returns the calculated time in the form of days and hours ?
    e.g. the time difference between the date 1.12.2007 from 7.00 pm to the date 1.1.2008 till 9.00 pm is
    30 days  and 2 hours or 30 : 2.
    answer as soon as possible.
    Thanks and regards,
    me

    Thanks a lot ya..
    thats an absolutely correct solution to my problem.  )

  • I am having issues with adjusting the duration of time for each still frame and transition in imovie 11.  Each time that I adjust these times, the app does not accept the change, and automatically enters its own time. Am I doing something wrong?

    I am having issues with adjusting the duration of time for each still frame and transition in imovie 11.  Each time that I adjust these times, the application does not accept the change, and instead automatically enters its own time. Is there a work around this? Or am I doing something wrong? Please Help!
    Thank you,
    lagrl

    Have you tried turning off automatic transitions ? Choose file - project properties and follow the dialogue box to change duration with a slider.  iMovie also doesn't allow a transition to be more than 50% duration of the clip its attached to. In other words if the clip is 4 seconds the transition cannot be more than 2 seconds and remember that relates to the first clip as the following clip (right side) is pulled back to overlay it.
    Does this help.  Perhaps you already know this ?

  • I am having multiple issues with syncing my iphone calendar and outlook There are often 1 hour time differences in the entries on the 2 devices and sometimes events that have been amended are not updated on iphone I mostly enter items on my laptop

    I am having multiple issues with syncing my iphone calendar and outlook calendar on my laptop
    I mostly enter the original items on my laptop
    There are often 1 hour time differences in the entries on the 2 devices and sometimes events that have been amended are not updated on iphone

    This sounds like an error in Time Zone support. The time zone needs to be the same in Outlook as well as the phone.

  • CRM - Time Rule - Date and duration difference in XML

    Hi All,
    Please provide your input on the below query .
    Objective
    To create a date rule in CRM system, the date rule is created using XML . The date  should be output of date - duration , omitting the weekends ( saturday and sunday ) .
    Input
    The input is  date ( lets says - 25.07.2014) and duration is 5 days . The output should be the input date - duration ,if there is any weekend which is falling between the input date and duration ,it will not count the weekend as number of days and provide the result .
    Please find the example ,In the below code
    VarTimeExp = 25.07.2014
    ConstDuraExp = 5days
    VarTimeExp will contain the output/result =  Date provided in the ZRC04_01 - Duration of 5 days in ConstDuraExp.
    Result = 20.07.2014 . It is considering the weekends in counting number of days
    Expected result - 18.07.2014, should not consider the weekends
    Note -  The factory calendar is already set and badi is implemented
    Case 1
    <?xml version="1.0"?>
    <TimeRule>
       <TimeRuleSource>
          <ruleline>
             <AssignTimeExp displaytype="AssignTime">
                <VarTimeExp displayType="VarTime"  name="RESULT"   position='B'>
                  <VarObjectExp displaytype="VarObject"  name="ZXXX001"/>
                </VarTimeExp>
                <MoveTimeExp displaytype="MoveTime" direction="-">
                   <VarTimeExp displayType="VarTime"  name="ZRC04_01"  position="B">
                    <VarObjectExp displaytype="VarObject"   name="ZXXX001"/>
                   </VarTimeExp>
                   <VarDuraExp displaytype="VarDura"  name="ZRC04_D4" timeunit="DAY">
                      <VarObjectExp displaytype="VarObject"   name="ZXXX001"/>
                   </VarDuraExp>
                </MoveTimeExp>
             </AssignTimeExp>
          </ruleline>
       </TimeRuleSource>
    </TimeRule>
    but when i implement the Case 1  code i am not getting the desire result . Please find the screen shot .
    Please provide your input on the above scenario and do let me know if you need more information from my end .
    Thanks
    OM

    Hi All,
    The issue is resolved .The above rule will work perfectly fine , only we have to provide the missing configration in the system . Please find the same below
    Also if you want to have constant duration then the above configration is also not required the rule will work without the above configration . Please find the rule written - when you have constant duration .
    <?xml version="1.0"?>
    <TimeRule>
       <TimeRuleSource>
          <ruleline>
             <AssignTimeExp displaytype="AssignTime">
                <VarTimeExp displayType="VarTime"
                                   name="RESULT"
                               position='B'>
                  <VarObjectExp displaytype="VarObject"
                                    name="ZXXX001"/>
                </VarTimeExp>
                <MoveTimeExp displaytype="MoveTime" direction="-">
                   <VarTimeExp displayType="VarTime"
                                      name="ZRC04_01"
                                      position="B">
                     <VarObjectExp displaytype="VarObject"
                                    name="ZXXX001"/>
                   </VarTimeExp>
                   <ConstDuraExp displaytype="ConstDura"
                                    duration="5" timeunit="DAY">
                      <VarObjectExp displaytype="VarObject"
                                    name="ZXXX001"/>
                   </ConstDuraExp>
                </MoveTimeExp>
             </AssignTimeExp>
          </ruleline>
       </TimeRuleSource>
    </TimeRule>
    Thanks,
    OM

  • There is no sound generated by Beep.VI when using frequency and duration time. why? Thanks

    Hi,
    I want to generate some beeps with certain frequency and duration time.
    Setting "use system alert? (T)" true, I can hear the beep; Setting "use system alert? (T)" false, certain frequency and duration time, I can't hear any sound. Why?
    attachment is the VI.  
    LabVIEW 8.2.1, WinXP
    Attachments:
    BeepWithFreq&Width.vi ‏8 KB

    Your PC speaker only covers certain frequencies..  Mine goes as low as 37 Hz, which I cannot be distinguished from other lower frequencies.  I have to go up to 80 Hz before hearing any difference. I can hear up to 14000 Hz and barely 15000 Hz.  Now, you cannot compare this with a Hi-Fidelity sound system..
    As for setting False, it will not play anything.  So all appears normal.. And of course, if it does not play anything, the duration setting is ignored..
    R
    EDIT:  I just read the othe people's posts..  The frequency & duration settings work fine on my machine.  It is a PC, running Win-XP.  
    (Finally, I can say something positive about a PC running XP.. )
    Message Edited by JoeLabView on 08-04-2008 06:13 PM

  • How to measure time difference between zero crossing of a sine wave and rise time of a pulse on a same graph?

    I have a 50Hz sine wave and a pulse signal on a same graph. The phase difference between two is between 0-90 degrees.
    Now I need to calculate the time difference between (when the sine wave crosses zero volts) and (when the pulse rises). The frequency will stay approximately same for both signals.
    The application is for a three phase generator. In simple words, when the time difference between the zero-crossing of sine wave and the pulse rises increases, that means that the load on the generator has increases.
    I am a beginner user of LabView (version 9, 2009), maybe it is a very simple problem but I've been pulling my hair out for the last few days and coudln't figure anything out. Any help would be greatly appreciated. I am using DAQ USB-6008 to measure these voltages and pulse from the generator and a sensor
    I have attached a jpg (a graph that i just made with excel to explain). The time 't' is what I am trying to measure
    Cheers
    Awais 
    Message Edited by awais.h on 03-30-2010 11:20 PM
    Message Edited by awais.h on 03-30-2010 11:21 PM
    Solved!
    Go to Solution.

    Hi
    Thanks for the code but I'm afraid it won't work. Like you said the probability of choosing a value that is on both graphs may not happen. This is something that I would like the code to do automatically.
    But I did use the previous code posted and made some modifications to it and it seems to work perfectly. Now the next thing is to be able to get just that one value that tells you the first time difference.
    Here is what I get using that code.
    As you can see from the t Values. I only need the one that is highlighted. If there is a way to filter out the rest it would be great.
    I was thinking of a while loop and as soon as the value is higher than 3E-5 it would store the number and stop the loop, but I'm not too familiar with arrays in labview.
    Here is the the code modified.
    As you can see, it wasn't that big of a modification and it still is your code.
    I will keep trying.
    Thanks for the help
    Attachments:
    FinalShockSpeed.vi ‏55 KB

  • How to find the date and time difference in InfoPath 2013?

    Hi All,
    My date and time format is like: 2013-12-24T10:47:38 and have three fields Start date, End date and Actual time taken.
    If start date and end date filled then actual time taken field should automatically should fill, for example 2 days 12 hours 48 min 3 sec.
    How to achieve this?

    Hi Sam,
     I believe we had discussed the same issue in the below thread. Can you please refer the below one?
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d93e16ff-c123-4b36-b60b-60ccd34f6ca7/calculate-time-differences-in-infopath?forum=sharepointcustomizationprevious
    If it's not helping you please let us know
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • Time differences between camera and iMovie

    Hi,
    When I import footage from my Mini-DV camera into iMovie I am seeing a difference between the time displayed on the tape and time displayed in iMovie. The camera says 48 seconds while iMovie says 44 seconds. I thought that it might be related to the framerate of the video in iMovie, but I have changed this to 25 fps which matches the video camera and am still seeing a different time. The framerate needs to be perfect as the footage is going to be shown side-by-side with a animated graph which builds with time.
    Does anyone have any idea what could cause this time difference?
    Thanks

    < scratching head > we had something about a NTSC/PAL issue.. hmm.. ?
    if possible, open an existing PAL project (window titles says DV-PAL), save it under a diff. name, import into that project, delete the not wanted parts..
    another option is, quit iMovie, delete ~/Library/Preferences any com.apple.iMovie.plist file.. relaunch iM.. that 'resets' iM... sometimes, it starts to stumble..

  • 10.0.01 ver. doesn't sign-in automatically i look up password manager, it seems it saves usernames and passwords, when i visit websites i am not automatically signed in and when i reopen mozilla it keeps on asking main password to sign-in all the time.

    10.0.01 version doesn't sign-in automatically... i look up password manager, it seems to it saves usernames and passwords, when i try to visit that website i am not automatically signed in and when i reopen mozilla it keeps on asking main password to sign-in all the time... it happened after mozilla updated itself... please help about it.. (i dont have problems like this in Opera browser)
    mozilla fills user name when i click but after that it asks for main password (whats the purpose of remembering passwords if it will ask for main password)
    by the way main password for password manager is of course useful but it şs useful whenever i want to use it not all the time i open mozilla .
    and not all the time i open a website or forum which i often use...
    there were no problems before it updated itself...
    please tell me the solution

    my problem is not related with using main password or not...
    in former versions of firefox i was automatically signed in to websites without any click... it wasnt asking me to sign-in (because my usernames and passwords were remembered-and saved in password manager)
    in this version they are remembered again but i have to write first 2-3 letters of my username and it remembers my username then it remembers password...
    for example when i clicked twitter.com my account and my homepage as automatically opened, but in this version when i click twitter.com it opens the sign-in page and i write first 2 letters of my user name it remembers name and password and then i signin
    (difference i was at where i want to sign in with one click--- but in new version 1click for webpage-1 click for clicking to username are-1-2 letter writing to find my user name-1 click to remember password-1 click to sign in) an addition: also if i am using main password i am entering main password and click to sign-in
    This can be little problem to u, but it is really annoying problem, 9-10 clicks more for each webpage which i wanted mozilla to remember my usernames and passwords... it also asks main password if i am using...
    if i want to visit 5-6 different websites it means 70-80 clicks more and 50-60 letters typing according to your main password .. (in opera and mozillas former versions it is just 5-6 clicks)
    so main problem is the cookies were remembered in all the sessions but after it updated to v.10.0.1 expiry date of cookies of same websites that i visit are just for one session... it is not related with the websites and their servers that i visit because if so how can Opera remembers all the time...

  • Firefox has crashed numerous times on me tonight, and I keep getting an unresponsive script error (Script: chrome://devany/content/main.js:254) regardless of what website I'm on. NoScript will not block this script, and it's popping up with an increasing

    Firefox has crashed numerous times on me tonight, and I keep getting an unresponsive script error (Script: chrome://devany/content/main.js:254) regardless of what website I'm on. NoScript will not block this script, and it's popping up with an increasing and alarming frequency. It's completely crippled my Firefox, and getting the a large enough window between unresponsive script warnings to get the Troubleshooting Information from Firefox took me a good 20 minutes. It's a very persistent script. I've already re-installed Firefox and restarted my computer, and scanned for viruses/malware. I'm on a Mac, if it makes a difference.
    == This happened ==
    Every time Firefox opened
    == Tonight. I can't say what site I was on, though I first noticed it on DeviantArt and thought it was their new layout producing problems. ==
    == User Agent ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

    yay, I had this same issue, and I too browsed deviantArt and also have got Deviantanywhere add-on installed. : D
    I'm so glad that You've found a solution and shared it with us.
    I was really getting worried that I'd done something to get malware installed on my 'puter. *Phew* !!
    I'm going to disable DeviantAnywhere after I post this and hopefully this will be fixed for me too!
    I actually hadn't kept my firefox up to date. but.. *shh...*
    I updated it and after I did, it told me that there was a script running that was not responding. : )
    yay for FireFox~
    ~QuinsY.

  • Its not at all startning and not giving any kind of error msg, and i restared pc many times and uninstall and installed many times, but still its not opening

    .its not at all startning and not giving any kind of error msg, and i restared pc many times and uninstall and installed many times, but still its not opening

    Also, if you downloaded earlier in the week, make sure you have the 37.0.1 updated that was released on Friday (I think).
    If needed, I suggest installing a slightly different way the next time:
    '''Clean Reinstall'''
    We use this name, but it's not about removing your settings, it's about making sure the program files are clean. As described below, this process does not disturb your existing settings. Do NOT uninstall Firefox, that's not needed.
    (1) Download a fresh installer for Firefox 37.0.1 from https://www.mozilla.org/firefox/all/ to a convenient location. (Scroll down to your preferred language.)
    (2) Exit out of Firefox (if applicable).
    (3) Rename the program folder
    ''(64-bit Windows folder names)''
    C:\Program Files (x86)\Mozilla Firefox
    to
    C:\Program Files (x86)\OldFirefox
    ''(32-bit Windows folder names)''
    C:\Program Files\Mozilla Firefox
    to
    C:\Program Files\OldFirefox
    (4) Run the installer you downloaded in #1. It should automatically connect to your existing settings.
    Any difference?
    Note: Some plugins may exist only in that OldFirefox folder. If something essential is missing, look in these folders:
    * \OldFirefox\Plugins
    * \OldFirefox\browser\plugins

Maybe you are looking for

  • Standby log files in Oracle Dataguard

    Hi, What is the difference between standby log files and online redo log files in a Dataguard environment? What is the use of standby log files? Thanks, Charith.

  • I need a win2000 video driver for a PXI - 8170

    Where do I find a video driver for a PXI-8170 embedded controller running Windows 2000 Professional?

  • PC card adapter question

    i just got a sandisk PC card adapter to read/write to a compact flash card. can i leave the adapter in the PC slot (w/o a card) when i'm not using it? i won't lose it that way. thanks , barbara power book G5 Mac OS X (10.4.3)

  • Display parallel currency values with KSB1.

    Hello, My local and CO currencies are both set to USD.  I have a hard currency of MXN.  With KSB1, if the document is entered in local currency (USD), is there a way to display the corresponding hard currency value? If the document is posted in hard

  • Folders don't exist for blocked add-ons. If they do, where are they?

    I read and followed all the instructions for uninstalling blocked add-ons. Safe mode didn't enable the Uninstall buttons and the folders for blocked add-ons don't exist in either the profile or installation extensions folders. They still show up as i