Toget Date diffrence

hi,
i have to get the date diffrence between todays date and the date stored in backend i have used the backend as access
but i m finding to retreive from backend and find the diffrecenc plz sm one help i have to complete my project actully the last year project and i m stuck up the main stuff ,........to calculate the fine according to the date difrece
Thanks in advanced

import java.util.Date;
import java.util.GregorianCalendar;
public class Mainzakas {
public static void main(String[] a) throws Exception {
Date d1 = new GregorianCalendar(2000,11,31,23,59).getTime();
Date today = new Date();
long diff = today.getTime() - d1.getTime();
System.out.println("The 21st century (up to " + today +
") is " + (diff / (1000*60*60*24)) + " days old.");
i m being using(refering) these code in these code tht d1 i have to get from database but tht is like giving me error tht ..inconvertable type ............plz do a favour use ur own eg tht u are retrieving date u haved saved in database and
then getting diffrence .....plzzzzzzzzzzzzzzzzzzzz
output i want is 2 month 3 days or 63 days will aslo do........

Similar Messages

  • Remote Desktop cannot verify the identity of the computer because there is a time or date diffrence between your computer and remote computer

    Hello.....
    I'm not able to log into Windows Server 2008 r2 server thorugh Remote Desktop connection, receiving below error message.
    This issue is with only three servers in the environment
    "Remote Desktop cannot verify the identity of the computer because there is a time or date diffrence between your computer and remote computer......"
    The date/time is correct on the server when i checked in the console session of the server
    Can see below messages in event logs
    Event ID 1014:
    "Name resolution for the name XYZdomain.com timed out after none of the configured DNS servers responded."
    Event ID 1053:
    The processing of Group Policy failed. Windows could not resolve the user name. This could be caused by one of more of the following:
    a) Name Resolution failure on the current domain controller.
    b) Active Directory Replication Latency (an account created on another domain controller has not replicated to the current domain controller).
    Any thoughts ....

    Hi,
    Have you tried to connect these three servers with IP address instead of computer name or DNS name?
    Check Remote Desktop Connection settings: Option-->Advanced-->Connect from anywhere-->Settings-->Connection Settings-->Select “Do not user an RD Gateway server”
    For more information please refer to following MS articles:
    Remote Desktop cannot verify the identity of the remote computer because there is a time or date difference between your computer and the remote computer
    http://social.technet.microsoft.com/Forums/en-US/w7itpronetworking/thread/c1f64836-5606-49b0-82eb-56be7f696520
    Cannot connect via Remote Desktop
    http://social.technet.microsoft.com/Forums/en-US/windowsserver2008r2general/thread/5087e897-8313-468c-ad37-ef18b87d4dd6
    Lawrence
    TechNet Community Support

  • Find date diffrence

    I need it urgent plz help me
    join date : 01-jan-2010
    let today : 01-feb-2011
    Ans is: *1 year 1 month* like this

    You can find example using INTERVAL datatype, here
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements001.htm#BABBICGH
    In your case, probably something like
    SELECT    EXTRACT (YEAR FROM  (let_date - join_date) YEAR TO MONTH) || ' years '
           || EXTRACT (MONTH FROM (let_date - join_date) YEAR TO MONTH) || ' months '
           || EXTRACT (DAY FROM   (let_date - join_date) DAY TO SECOND) || ' days'
    FROM   your_table;Regards
    Peter

  • DATE diffrence with negative result

    Hi Experts,
    When I use
    number_of_days = date1 - date2  I always has a positive
    result even if date1 is greater than date2.  I need to
    include the sign.  any one knows how?. I am storing
    the result in a numc field.
    Thanks.
    Rose

    hi,
      then check
    <b>copy this program it is working fine.</b>
    DATA : date1 TYPE dats,
           date2 type dats,
           days  type i.
    date1 = sy-datum.
    date2 = date1 - 2.
    days = date1 - date2.
    write :/ days.
    days = date2 - date1.
    write :/ days.
    <b>result of the program.</b>
            2         
            2-        
    <b>or</b>
    if date1 > date2
      answers negative
    endif.
    Message was edited by: Manoj Gupta

  • Regarding date diffrence

    hello all,
    i want to calculate the diffence between two dates the result should in days
    is their any standard way of doing this?
    can i do this way get the day,month and year of two dates
    (like this == year*12*31+month*31)
    substract it , is it right?
    thanks
    daya

    Search the forums. This is a FAQ. And it's not as easy as it sounds:
    Consisder two Dates objects that differ by 12 hours -- are they one
    day apart or on the same day? Depends on their time of day, eh?
    One way to calculate the difference between two Dates (or better,
    Calendars) is to roll each back to midnight, and then calculate from
    their timestamps.

  • Halting Timer() in order to show diffrent data

    I I wrote this little script shown below, that shows images from an array and displays them one by one on the screen. Now i have been trying to implement how to display another screen perhaps while halting all the action on the main screen and display a movie script.
    I was thinking that displaying it on the second Scene would be an ideal solution but it does not seem plauisble. I would llike to display the movie cllip on the same screen then using actionscipt, but with out having all the rest of the code play.
    So when the function
    displayCars() gets called after the time had been calculated it should halt all the timers and clear the screen and then output a movieclip
    After 10s i would like to restart all the action so it could continue again.
    any ideas on how to halt, clear and restart this stuff
    Thanks
    My Attempt
    import fl.transitions.*;
    import fl.transitions.easing.*;
    import flash.events.TimerEvent;
    import flash.events.Event;
    import flash.utils.getDefinitionByName;
    //Setting up //with date params
    var todayDate:Date = new Date();
    //1st Timer initializing the | First Timer |
    var delayCall:Number = 1000;
    var repeatCall:int = 1;
    var firstTimer:Timer = new Timer(delayCall, repeatCall);
    firstTimer.start();
    //2st Timer initializing the | Second Timer |
    var del:Number = 1000;
    var rep:int = 1;
    var secondTimer:Timer = new Timer(del, rep);
    //Setting for the date diffrence
    var dtDate1:Date = new Date();
    var dtDate2:Date = new Date(2009, 6, 8, 12, 47);
    var leftTime:Number = dtDate2.getTime() - dtDate1.getTime();
    var delay:Number = Math.floor(Math.abs(leftTime));
    var repeat:int = 1;
    var time1:Timer = new Timer(delay, repeat);
    time1.start();
    time1.addEventListener(TimerEvent.TIMER_COMPLETE, displayCars);
    //defining the beverage values
    var carNames:Array = ["bmw", "ferrari", "lamborghin", "mercedes"];
    var nextCar:Number;
    //Movie Clip + Transition releated variables
    var mc:*;
    var myTween:Tween;
    var myPhoto:TransitionManager;
    //Event Time Listeners
    firstTimer.addEventListener(TimerEvent.TIMER, bringIt);
    nextCar = 0;
    function displayCars(event:TimerEvent):void
    gotoAndStop(1, "Scene 2");
    function bringIt(event:TimerEvent):* {
    firstTimer.removeEventListener(TimerEvent.TIMER, bringIt);
    var classRef:Class = getDefinitionByName(carNames[nextCar]) as Class;
    mc = new classRef();
    mc.y = 35;
    addChildAt(mc, 0);
    myTween = new Tween(mc, "x", Elastic.easeOut, 0, 200, 3, true);
    myTween.addEventListener(TweenEvent.MOTION_FINISH, takeIt);
    return mc;
    function takeIt(event:TweenEvent):void
    myTween.removeEventListener(TweenEvent.MOTION_FINISH, takeIt);
    secondTimer.start();
    secondTimer.addEventListener(TimerEvent.TIMER_COMPLETE, outTween);
    function outTween(event:TimerEvent):void
    secondTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, outTween);
    myPhoto = new TransitionManager(mc);
    myPhoto.startTransition({type:Photo, direction:Transition.OUT, duration:4, easing:None.easeNone});
    myPhoto.addEventListener("allTransitionsOutDone", resetValues);
    function resetValues(event:Event):void
    myPhoto.removeEventListener("allTransitionsOutDone", resetValues);
    removeChild(mc);
    nextCar++;
    secondTimer.reset();
    firstTimer.start();
    firstTimer.addEventListener(TimerEvent.TIMER, bringIt);
    if( nextCar == carNames.length)
        nextCar = 0;

    Hi Chirs,
    From your desription, you want to createa a chart to show all the months on the chart no matter it has data on that month or not, rigth? If in this case, we can create an other dataset to show all the month, and then use the lookup function to get the month
    QTY. The steps below are for you reference.
    Create an other dataset use the query below.
    DECLARE @TMP TABLE (Month nvarchar(20),QTY INT)
    INSERT @TMP SELECT 'Jan',0
    INSERT @TMP SELECT 'Feb',0
    INSERT @TMP SELECT 'Mar',0
    INSERT @TMP SELECT 'Apr',0
    INSERT @TMP SELECT 'Mat',0
    INSERT @TMP SELECT 'Jun',0
    INSERT @TMP SELECT 'Jul',0
    INSERT @TMP SELECT 'Aug',0
    INSERT @TMP SELECT 'Sep',0
    INSERT @TMP SELECT 'Oct',0
    INSERT @TMP SELECT 'Nov',0
    INSERT @TMP SELECT 'Dec',0
    SELECT * FROM @TMP
    Drag [Month] filed to Category Groups and drag [QTY] field to Values.
    Then change the of [QTY] to:
    =Lookup(Fields!Month.Value,Fields!Month.Value,Fields!QTY.Value,"DataSet1")
    The report looks liek below.
    If you have any questions, please feel free to ask.
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Date Dimension not updating correctly

    Hi
    My current date dimension underlying data was due to expire soon so I set about trying to create a new one.
    I got hold of the script that it was based and went about re-creating the data like for like.
    I pointed the date dimension at this new data structure and it all processed fine.
    When I was doing some testing I noticed althought the total figures were fine, some of the year figures were a little off compared to the underlying data.
    I found that dates such as 31/12/2012 were being classified as year 2013. The month was also being classified as January but the date was still showing as 31 December 2012
    I switched the date dimension back to the old structure and all year numbers were fine.
    I decided to recreate the Date Dimension in the cube using the same structure as the current date dimension and when it processed with the new data structure all the numbers are correct.
    I tried clearing cache but I am baffled as to why the new data structure won't work with the existing Date Dimension but will work with a newly created date dimension in the same cube?
    Regards

    Hi
    I seemed to have solved it (although I am still testing), there was a data diffrence in the week key and that it was over lapping with the end of the year so I changed it to match what I already had.
    It still doesn't explain that before making the change when I created a new dimension it seemed to work ok.
    I had a look at the XML and the only difference that I could see was that the original date dimension had a Time Binding that was generated on the server or the data source.

  • Anyone know of a good DATA diff tool? assume schemas are the same...

    Hi,
    I was wondering if anyone has used or come across any tools that compare data across schemas. We can assume the table structures in 2 schemas are identical and we just want to detect data diffrences between them.
    I can think of a way to do this with some PL/SQL but thought the problem was common enough that a tool might already be available.
    Oh - and I need to wrap processing around this so it would need some sort of API (i.e. I'm not looking for a GUI)
    Thanks!
    Message was edited by:
    ennisb
    Message was edited by:
    ennisb

    Thanks.
    I'm on 10G and this looks to be an 11G tool?
    But this comment made me unsure...
    Can be used to compare tables, views, and materialized views backward compatible to 10gR1 due to need for ORA_HASH.

  • Group By, Sort operation on pl/sql collection

    Hi,
    Is it possible to do a group by or a order by operation on a pl/sql table of records?
    Thanks,
    Ashish

    If you are building your cllection from a database then why dont you SORT in the SQL that you use toget data from the database. If that dose not help then this link will help you.
    sort data of pl/sql table
    Thanks

  • Calculate the day from posting day in Customer Statement Report PLD

    Hi All,
    I do try to copy the PLD of Customer Statement Report to make modify. I try to calculate the how many day from the posting date until today. What is the formula and operation for this calculation?
    Also I found out that the posting on PLD is free text. How to get a real value from PLD? Any idea on this?

    Greetings,
    You can use a formula field to calculate the date diffrence between the posting date and the system / server date. But because the date value shows up with the DB specified type, you can 'chop up' the date into something more manageable, something along the lines of:
    Field_XXX - (CONVERT(CHAR(8),GETDATE(),10))
    where Field_XXX is your posting date field
    * in my hurry to post i realised this was for the Query Manager, let me dig through my implementation folder for the right formula*
    I dont quite understand your last line though:
    "Also I found out that the posting on PLD is free text. How to get a real value from PLD? Any idea on this?"
    Edited by: Davinder Singh on Mar 27, 2008 3:46 PM

  • DateTime converting into hrs

    Hi.
    What is the sytanx used when calculating the avg time taken to resolve a ticket? 
    I have the Arrival Date /Time  and Resolved Date/Time field .  This is how I used but the results seems to incorrect.
    Say if I have  ArrivalTime(7/1/2009   5:25:15PM) and ResolvedTime (7/1/2009   7:19:58PM), the formula that I used is
    (ResolvedTime - ArrivalTime) , but the calculation is wrong.  I am missing something out.
    Your help on this is greatly appreciated.
    Thanks
    Cauvery

    Hi Cauvery,
    if your DateTime diffrence should not exeed 24 hours(I day), you will get result in Time() format itself. with the following solution.
    numbervar tsecs := datediff("s",{StartDateTime},{EndDateTime}); // number of seconds between the dates
    tsecs := remainder(tsecs,86400); // find the left over seconds(86400 is seconds in a day)
    numbervar nhours := truncate(tsecs/3600); // divide by the seconds in an hour
    tsecs := remainder(tsecs,3600); // find the left over seconds
    numbervar nmin := truncate(tsecs/60); // divide by the seconds in a minute
    tsecs := remainder(tsecs,60); // find the left over seconds
    time(nhours,nmin,tsecs); //Clubing # values with Time() function
    If the Date diffrence will exeed 24 hours wee need to calaculate Days also. Like
    numbervar tsecs := datediff("s",{StartDateTime},{EndDateTime}); // number of seconds between the dates
    numbervar ndays := truncate(tsecs/86400); // divide by the seconds in a day
    tsecs := remainder(tsecs,86400); // find the left over seconds(86400 is seconds in a day)
    numbervar nhours := truncate(tsecs/3600); // divide by the seconds in an hour
    tsecs := remainder(tsecs,3600); // find the left over seconds
    numbervar nmin := truncate(tsecs/60); // divide by the seconds in a minute
    tsecs := remainder(tsecs,60); // find the left over seconds
    if ndays > 0 then
    nhours:=nhours+ndays*24;
    totext(nhours,0)+":"+ totext(nmin,0)+":"+totext(tsecs,0) //Making A single String
    Regards,
    Salah.

  • Hyperion Intelleigence-need an idea

    Hi,<BR>I used to work with Essbase. Now there is a requirement for Hyperion Intelligence. So my manager asked for self learning of this tool. To my understanding essbase is the only back end tool of hyperion and all other tools are the front end tools. So, this is also a front end tool where we need to map the source columns to the reports. Does it require any other skills like java script.does my essbase knowledge helpful in intelligence. <BR>Expecting your comments.<BR><BR>Regards<BR>R.Prasanna

    <p>Umm...</p><p> </p><p>the different hyperion tools that you can use to produce reportsfrom Essbase could be :</p><ol><li> Excel Addin - Lot of people use this since they dont haveto spend too much money on other tools and the user training can belimited. It gives nicely formatted reports like any othe excelreports. But to put to a good use, you need to know some VBAprogramming (this doesnt have a big learning curve). You can writequeries in excel add in using Query designer but then it may notmeet the formatting expectations.</li><li>Visual Explorer - This is a graphical tool(requires additionallicense) which can be used. This is actually a nice tool but Ihavent used it.</li><li>Hyperion Reports - If you formatted reports which can bedistributed over web or using emails, this could be a way to go.This can give really nice presentable reports and be distributedwith little effort.</li><li>Hyperion Analyzer - I would prefer to do this if users neededmore functionality than just looking into data. if they need to dodrill through in the cube and make their ad-hoc wuick reports withlot of criteria selection. In this you can make reports fromrelational and OLAP cube and do some fancy stuff where you can letthem analyze data, let them you cube navigator and make charts andstuff.. This is pretty cool way to present if users want to seecharts and pinboards and other graphical stuff with lot of criteriaselection.</li><li>Brio - I would go to brio when I need to combine data frommultiple sources. You are already working on Brio, so I think therewont be need to explain this</li></ol><p> </p><p>There are some other 3rd party tools available which can help toget data out of the cube. First you need to decide upon yourdeliverables and then come to a decision on the type of tool thatwould best suit the need.</p><p> </p><p>Hope this helps !!!</p>

  • Date and time diffrence calculations

    Dear Experts,
    I have a doubt regarding the date and time diffrence calculation please help me out.
    This is regarding the report called u201CVehicle tracking systemu201D. The purpose of this report is to give the user information like how many vehicles have come in and how much time each vehicle has parked in the filling in the refinery and also the average time taken for a customer.
    For this we have created 4 info objects called
    1)     Park In Time
    2)     Park In Date
    3)     Gate Out Time
    4)     Gate Out Date
    We have created a routine which calculate the difference in Vehicle Park In Date & Time to Gate Out Time and Date
    The Time difference is number format.
    Example: For Vehicle1
    Park in Date and Park in Time are         27.11.2008 and 17:43:35
    Gate out Date and Gate out Time are     29.11.2008 and 09:36:16            
    Here routine will calculate the difference in the above date and time and the output is like this     1,155.138,000 (i.e. 1day, 15 hours 51 mins and 38 seconds) that means the vehicle has parked for 1 day and 15 hours etc.
    But we require the output like    1 day, 15:51:38
    Please give us the solution how to go about it.
    Thanks in advance,
    venkat

    Hi,
    I think in regard to your problem, the solution will be to make the variables in the query runtime by the replacement path variable.
    Please find the below link, its very much self explanatory and in regard to your problem.
    Hope it helps!
    [http://sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html]
    Regards,
    Neha.

  • Diffrence of two dates

    hi all
    i hav a problem of portability with solaris and slackware.it doesnt seems to be working out.i have the time stamps in the form of
    Apr 16 16:32:50
    Apr 16 16:36:07
    now i want to convert them into minutes and find out the diffrence.now in slackware i can use the date command
    and it works find for me.
    echo $(( $(date -d 'Apr 16 16:32:50' '+%s') - $(date -d 'Apr 16 16:36:07''+%s') ))
    it works fine for me in slackware but not in solaris.becoz solaris doesnt seems to recognise -d and %s.if u can help me out how to get the same working in solaris,your help will be appreciated,
    abhishek

    hi all
    i hav a problem of portability with solaris and slackware.it doesnt seems to be working out.i have the time stamps in the form of
    Apr 16 16:32:50
    Apr 16 16:36:07
    now i want to convert them into minutes and find out the diffrence.now in slackware i can use the date command
    and it works find for me.
    echo $(( $(date -d 'Apr 16 16:32:50' '+%s') - $(date -d 'Apr 16 16:36:07''+%s') ))
    it works fine for me in slackware but not in solaris.becoz solaris doesnt seems to recognise -d and %s.if u can help me out how to get the same working in solaris,your help will be appreciated,
    abhishek

  • Diffrence b/n char date &key fig date

    hi experts,
    what is the diffrence b/n the date field in char &date in key fig
    in what scenario we will use this
    pl give clear idea about how to use
    thanks in advance
    venu

    Hi,
    according to me, the difference between DATE(s) as char. is you can use this
    char. as a display column or as a free char. but you'll not be able to perform any
    restrictions or use as a conditional parameter or perform any calculation on this
    DATE, whereas if the DATE is avaialbe as a keyfigure, could do all the above
    mentioned activities...that's advantage of having date as a keyfigure, to build a
    complex logical query..
    Hope it helps..
    pls. assign points if useful..
    Cheers,
    Pattan.

Maybe you are looking for

  • New Mac: Why are CC and Photoshop Elements not working when Lightroom and Reader are fine

    Last week I changed computers (swapping an old Mac for a 13-in MacBook Pro Retina running OSX Yosemite 10.10.3. I copied all my data over to the new machine using Migration Assistant. All programs work fine (including my copy of Lightroom 3 and Reade

  • Error in creating a substitute in UWL-SRM 7.0

    Hi Experts, We are on SRM 7.0, using the portal. When I try to create a substitution it is working fine untill I try to save the settings. The system respons with an error: _System does not support substitution methods_ Has anyone experience with thi

  • On Dreamweaver CC how do I get to the css rule definition box?

    On the other Dreamweavers when I wanted to edit a css, I selected the css and clicked on the pencil icon to open the css rule definition box. The only way I find to get acess to the css rule definition box on the new CC is when I am creating a new di

  • List Entries - Not Showing in Application

    Hi All, Since upgrading to APEX version 3.2 I've seen an issue when creating list entries. The issue I see is when a new list entry is created it does not show up through my application. I can however see it's definition through the apex builder. If

  • IMac Maverick Upgrade - Printer Problems

    I recently upgraded to Maverick and now my HP color laser jet CM 1415fnw does not work.  I first tried calling HP and was on hold with them for a couple of hours and finally gave up.  So I am coming to Apple now to inquire if they know anything about