How to compare current date with past date

Sample code for comparing current date with past date
i dont want to Calender.set method to compare it.
How can i do it?

PLEASE stay with ONE thread:
http://forum.java.sun.com/thread.jspa?threadID=5143991&tstart=0

Similar Messages

  • How to compare current time with any particular time?

    Hi All,
    Problem:
    I have a form which accept data from user but i want that user can enter data only before 4 in the evening after that no data will be accepted and user get any message. Now the problem is I want to compare the current time with 4 o clock or 16:00:00 but i dont know how to check whether the current time is greater or lesser than 4. Till now my code are like this: if(tt.equals("16:00:00")){}else{}
    where tt is current time. but this is not the feasible solution for my second clause.
    Any kind of help will greatly appreciate.
    Thanks

    One more thing:
    I find timestamp class quite helpful in my case but i
    dont know how to implement the before() method
    of this class.
    Any idea.* You wouldn't implement before(). You'd just use it. It's already implemented for you.
    * before() doesn't just compare the hour of the day. It compare two date & time objects to see which one is greater--that is, it effectively looks at all the fields, not just HOUR.
    * You don't need Timestamp if you're not dealing with a database.

  • To compare date with another date in string in siebel bip report

    Hi,
    In my rtf I am comparing a Date1 with a date in string i.e. '10-NOV-14'. If Date1 is less than '10-NOV-14' I am dispalying a certain text and if not another text.
    This condition is working fine if Date1 have 2014 values but if  Date1 cointains 2015 date than the mentioned condition is falling.
    Kindly suggest any solutions.
    Regards,
    Siddhika

    This example may help:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:param name="currentDate"/>
        <xsl:variable name="firstDate" select="concat(substring($currentDate, 1,4),substring($currentDate, 6,2),substring($currentDate, 9,2))"/>
        <xsl:template match="/">
            <xsl:apply-templates select="//item"/>
        </xsl:template>
        <xsl:template match="item">
            <xsl:variable name="secondDate" select="concat(substring(submissionDeadline, 1,4),substring(submissionDeadline, 6,2),substring(submissionDeadline, 9,2))"/>
            <xsl:choose>
            <xsl:when test="$firstDate &gt; $secondDate">
                <xsl:call-template name="late"/>
                </xsl:when>
                <xsl:when test="$firstDate &lt; $secondDate">
                    <xsl:call-template name="ontime"/>
                </xsl:when>
                <xsl:when test="$firstDate = $secondDate">
                    <xsl:call-template name="same"/>
                </xsl:when>
                <xsl:otherwise>Monkeys<br /></xsl:otherwise>
            </xsl:choose>
        </xsl:template>
        <xsl:template name="ontime">
            This is on time
        </xsl:template>
        <xsl:template name="late">
            This is late
        </xsl:template>
        <xsl:template name="same">
            This is on time
        </xsl:template>
    </xsl:stylesheet>

  • Comparing a MaxDate with another Date field

    Hi there,
    I am trying to create a report that has  components on it, ReportDate, MaxReportDate, and JobID. I want to compare a max date with another date in my Web Intelligence report. For example, I have a field called Report Date. I have applied the Max() function to find the most recent date in the list of Report Dates. Therefore, I used this:
    Max([ReportDate]) --> MaxReportDate
    Then I want to compare the original Report Date field with the MaxReportDate and return the JobID if the ReportDate = MaxReportDate. Therefore, I used this for the JobID2 formula:
    = [JobID] where (ReportDate = MaxReportDate)
    This is not working. Am I doing somehting wrong? By the way, I am using SAP Business Objects BI Platform 4.0 Client Tools (version 14.0.2.364).
    Please help! Thanks!
    -Janice

    I did create a variable called MaxReportDate with the formula Max(ReportDate). When I test this variable, it works perfectly fine. However, when I use it to compare against ReportDate, there's where it gets tricky. 
    So it looks like the If ReportDate=MaxReportDate then JobID works. However, if I try to replace JobID with any other Measure variable, it does not return accurately. For example, say I have the following data:
    ReportDate Price
    11/30/2011  10
    13/30/2011  15
    I put it the following formula to get the price for the max report date:
    If [Report Date] = [MaxReportDate] then [Price]
    It should give me 15. Instead, it sums the numbers and I get 25.  Why is that?

  • How to put a check with the date

    Hi,
    I have created a ztable with 3 fields .
    clientcode(3),
    date,--date geneated
    version--- fileversion
    i need to update this table everytime i execute the data. Every time version shd get incremented when i execute the program.  When i excute the program next day version shd be updated by '1'.
    i wrote the code for version updated i'm not getting the logic how to put a check with the date.
      SELECT *
       FROM zfi_enetflver
       INTO TABLE gt_flver.
      SORT gt_flver DESCENDING.
      CLEAR: gv_dt, v_file.
      CONCATENATE sy-datum6(2) sy-datum4(2) INTO gv_dt.
      READ TABLE gt_flver WITH KEY client_code = gv_clcd.
      IF sy-subrc = 0.
        idx = sy-tabix.
        IF gt_flver-zdate = ' '.
          gt_flver-zdate = sy-datum.
        ENDIF.
        IF gt_flver-version = ' '.
          gt_flver-version = '001'.
          gv_filever = gt_flver-version.
          MODIFY gt_flver INDEX idx TRANSPORTING zdate version.
          MODIFY zfi_enetflver FROM TABLE gt_flver. "TRANSPORTING version.
          CONCATENATE 'E:\' 'ENET\' gv_clcd gv_dt '.' gt_flver-version INTO v_file.
        ELSE.
          gt_flver-version = gt_flver-version + 1.
          gv_filever = gt_flver-version.
          MODIFY gt_flver INDEX idx TRANSPORTING version.
          MODIFY zfi_enetflver FROM TABLE gt_flver .
          CONCATENATE 'E:\' 'ENET\' gv_clcd gv_dt '.' gt_flver-version INTO v_file.
        ENDIF.
      ENDIF.
    clientcode is the key field in ztable do i need to make date field key ??
    please help me with the logic

    You need to implement below logic:
    1. check if field_date = sy-datum. in this case do nothing.
    2. else . move sy-datum to field_date .
    3. modify your internal table with field_date .
    4. populate final table to database table .
    hope you get it.

  • Hello, I recently bought a new Laptop and wanted to sync all my data from the old one. Accidentaly I merged my Sync Data with Device data, how can i recover it?

    hello, i recently merged my Sync data with New device Data , because the option MERGE THIS DEVIC's DATA WITH SYNC DATA was checked, how can i recover my stuff back ? from a previous state

    Sorry, SYNC don't have that option right now

  • I want to run down how dissatisfied I currently am with Verizon Wireless

    I want to run down how dissatisfied I currently am with Verizon Wireless; this stated with the pre-order of the iPhones on Friday I like many other customers received the "ecdp" error on the web site and it took 45 minutes to actually be able to place the order.  I got the order in and had a 09/19/2014 ship date; spoke with a few Customer Service Reps in various areas such as 611, on many of the 800 numbers available, Internet Orders (including a Supervisor) and even a Social Media Service Rep all who have confirmed this ship date to be accurate. 
    Well today (09/17/2014) I check the Pre-Order Status page and my date has been changed to 10/14/2014 so I call in to speak to Internet Orders and the Rep advises me that yes my date was pushed back but no reason is supplied, I asked to speak to a Supervisor and was transferred to Howard, Operator # 2431235, who stated that yes the prior rep was accurate and that there was no reason available as to why my ship date changed.  Howard continues by stating that as per upper management, Apple reported to Verizon that no iPhone 6+'s would be available at launch for Verizon to ship and that this has been common knowledge, within the company, that the 6+'s were not shipping until 10/14/2014, and that prior Verizon employee's to include supervisors were misinforming me of my shipping date.  Howard continued to state that the reason I got the "ecdp" error was because of the company that I work for as Verizon offers a discount so the 'ecdp" error is not something Verizon is currently addressing.  Howard then tells me not to worry that with the 10/14 date is a guaranteed delivery date and not to worry, if the phones come in early the order will be filled, I at this point ask Howard to note my account with our conversation to include the fact that he stated the 10/14 was a guaranteed date, at this point he states that while he is telling me this he will not put it in writing as at that point Verizon would be obligated to meet that date at minimum and he was not willing to put his position on the line if the phone is not shipped by that date(this can be confirmed by reviewing the recording of the call as I was advised that I was on a recorded line).  I then asked to speak to his supervisor and was told his supervisor went home for the day and that he was the highest level supervisor on at this time.  When I then asked for his supervisors contact information to lodge a complaint he said that I would need to call back in on 611 from my handset as Customer Service handles complaints not supervisors. 
    I did call back and speak with a Representative on 611 who tried to assist but was not able to do much, this rep took my information and is having their supervisor call me to try addressing the way Howard handled the call however this has not occurred at the time of this writing.  I did tell this rep that I was honestly considering going to another carrier, (I have been with Verizon 7-8 years and currently have 10 lines of service on my account) I know I will not get the iPhone 6+ on launch day with another carrier which was not the driving factor but rather the way Howard dealt with the situation and the lack of respect that as a customer of Verizon I have always got from other representatives, as you know it takes one person to sour someone on a whole company, Howard even stated that if I want to go to another carrier that was fine with him.  However, the Customer Service Rep I spoke with after Howard (I wish I could remember his name) calmed me down not to leave Verizon but did agree that a complaint needed to be filed, personally I would like to file it directly with an Associate Vice President or higher but do understand that there is a “Chain of Command” that needs to be filed
    Let this be a warning to anyone who call internet sale and gets Howard, operator #2431235, I would suggest you immediately request a different supervisor that will treat you with respect.  As stated above Howard will tell you that the iPhone 6+ was not and has never been available to ship on launch day due to Apple purposely not providing enough units to meet the demand and that Verizon knew this while taking our pre-orders. 

    I feel your pain Robert. I do believe VZW and Apple knew all along the I6 Plus would not be available on 19 Sep and that it was a way to bolster new contracts, renewed contracts and apple sales stats. It's unfortunate the company wasn't more clairvoyant, most of us would have still pre-ordered but been a little less frustrated.

  • Why does my phone use data with cellular data turned off?

    I have problems with my iPhone 5 using data on its own. It usually happens at night, with all the apps closed and plugged in to charge (should be connected to my wifi). Recently, I started turning off my cellular data any time I'm at home out of desperation to save my data. Last night, my phone used 6MB of data with my data off, plugged in. I use My Data Manager to track, it matches up with AT&T's record of my data usage, so I'm pretty sure the app is not wrong. I have the 200MB plan, so I have to be very careful and it's incredibly frustrating to wake up and find 6MB gone when cellular data was turned off. Does anyone know what's going on?  I haven't bothered calling Apple or AT&T, I never get anywhere with either one.

    I'm not familiar with My Data Manager but from the name I would think it would tell you what app or apps have used the data and that might help narrow down the problem. If it doesn't have that information, you can go to Settings > Cellular > Use Cellular Data For and that shows usage by each app and if you click on System Services in that list it will also give details of that usage. The numbers are since you last reset the statistics (bottom of that screen). With a little time and detective work you may be able to identify the cause.
    Also, there have been many discussions on various internet forums of AT&T (and other) reporting of the time of data usage not matching the actual time of the use. The usage numbers over a number of days for example are accurate but usage reported at 2AM may actually be a summary of some types of use that happened the previous day.

  • Can anybody tell how to compare two documents with two pointers controlled with the same mouse

    can anybody tell how to compare two documents with two pointers controlled with the same mouse ??

    I saw what I need but in a game to find the differences between two photos (two screens, two pointers controlled by one mouse), and I need a program to make the same thing   (compare a chosen files)

  • Billing user exit to overwrite the service rendered date with billing date

    Hello,
    My client would like to determin the rebate conditions based on billing date. However, the system only uses the service rendered date for rebate determination.
    Therefore, I am trying to overwrite the service rendered date with billing date at the time of billing creation.
    Could you please let me know what user exit I can use?
    I can't user the user exit RV60AFZC because the billing date is not determined when this user exit is running.
    Your help would be appreicated! I will give you good points! Thanks

    Hi Londa,
    Try using one of the following includes for your requirement.
    (a.) rv60afzz
    (b.) rv60afza
    (c.) rv60afzb
    (d.) rv60afzd
    (e.) BAdi SD_CIN_LV60AU02
    or if you are working with ECC 6.0 use the Enancement Spot ES_SAPLV60A available from SE80 by giving package VF and then selecting Enhancements and then expanding Enhancement Spots
    Hope these are helpful to you. Reward accordingly.
    Thanks and Regards,
    Maddineni Bharath.

  • Generic Extractor: enriching GL Data with Purchasing Data

    Experts,
    This is my first time with Generic Extractor.
    Requirement:
    We have a requirement to enrich GL data with Purchasing data via the Material Document Number.
    I need to provide this upto to the datawarehouse layer wherein another team will take over.
    Solution idea:
    Material Document is not part of the datasource 2LIS_02_SCL.
    a. Should I enhance this datasource to include material number  OR
    b. Develop a concept to create a generic delat enabled extractor that pulls data from EKBE, GR and IR information.
    In EKBE multiple material documents can exist per PO. The extractor returns 2 record per PO (before and after image) with the updated information.So if we have the first GR with Material document 901 and then a second GR with material doc 902 the extractor loads 3 records. New record, Before image and after image and the only one stored in BI is the after image. material doc would have value 902 if enhanced.
    For the generic extractor approach the  the ability to load deltas is crucial, since the EKBE table is very big. Maybe
    "CPUDT-Day On Which Accounting Document Was Entered" and "CPUTM-Time of Entry" can be leveraged as delta hook.
    Any ideas???
    Thanks,
    Jain

    No one answered

  • How to compare Sale data with Previous data

    Hi Guys,
        Any one tell me how we will compare Sales data with Last year Sale data. Is there any T.Code or any kind of Report in the SAP. If available please suggest the same.
    Thanks & regards,
    Naveen Bhatia

    Hi Naveen,
    Did yo ucheck t-code SD01
    Regards
    Rohit.

  • Compare - Current Data with Perious Data.

    Experts,
    We have created default report like below
    Date - Company - Product - SCode - Amt Spent - Net Amt - Calls
    12/12/2010 C1 P1 Code1 1000 1500 15
    13/12/2010 C2 P4 Code2 1500 1200 10
    12/12/2009 C1 P3 Code3 2000 1700 25
    11/12/2010 C3 P1 Code4 3000 1600 10
    11/11/2009 C2 P2 Code5 5000 3000 30
    Grand Total 12000 9000 90
    Here we are using Column selector for Date column to change the report from Date to Week (or) Month (or) Quarter (or) Year.
    My Questions
    1. I want to compare Default Date report with Perious Date, Last month Date and Last Year Date.
    2. If I select Month from Column Selector then I want to compare Month report with Last Month, Last year Month or Perious of Last year month.
    3. If I select Year from Column Selector then I want to compare Year report with Last year, or Perious of Last year and so on.
    Please help me, how can we achive the above task.
    Thanks in Advance.
    Balaa...

    Hello,
    First you have to define the new measures for last month, last year and so on. You can refer to this link:
    http://www.rittmanmead.com/2007/04/obi-ee-time-dimensions-and-time-series-calculations/
    After that, what you can do is instead of using a "Column Selector" you should use "View Selector". You can create different views, one for month, other for Year and include them into a "View Selector".
    After that you can add it in "Compound Layout".
    Regards,
    JorgeRS.

  • How to compare a given date with System date?

    The date input for me is of type String and it is in the format
    String s = "1900-00-00 00:00:00.000";
    I need a helper method that will take the above string as input and it should return Boolean value depending on the following condition.
    Date should be less than or equal to current date and greater than the date prior to the date 50 years of current date.
    Thanks in advance...

    I got it.
    String date = "3000-03-19 12:34:56.000";
    Calendar c = Calendar.getInstance();
    Calendar c1 = Calendar.getInstance();
    Calendar c2 = Calendar.getInstance();
    Date d = new Date();
    Date d1 = new Date();
    Date d2 = new Date();
    c1.set(Integer.parseInt(date.substring(0,4)),Integer.parseInt(date.substring(5,7)),Integer.parseInt(date.substring(8,10)),Integer.parseInt(date.substring(11,13)),Integer.parseInt(date.substring(14,16)),Integer.parseInt(date.substring(17,19)));
    c2.set(1,c.get(1)-125);
    d = c.getTime();
    d1 = c1.getTime();
    d2 = c2.getTime();
    System.out.println(d1.compareTo(d));
    System.out.println(d2.compareTo(d1));
    System.out.println(".....");
    System.out.println(d1.compareTo(d));
    System.out.println(d1.compareTo(d2));
    if(d1.compareTo(d)<=0 && d2.compareTo(d1)<=0)
    System.out.println("Success");
    }

  • How to compare, current value in :block.text_item with the database value

    Hi
    Could you please tell me
    How to compare the current value in :block.text_item with the corresponding database column value.
    I am using forms 10g
    There is block and there is an text Item in that block.
    When I run the form and query the block (tabular), the :block.text_item shows me, whatever value there in the database.
    Now I add some value in the :block.text_item to the existing value.
    now
    the :block.text_item contains old+ new added value
    whereas
    the database table contains 'old' value
    Now on a button click , I want to find out what is the value that I have added
    Could you please tell me, is it possible without writing a select query?

    Hello,
    Now on a button click , I want to find out what is the value that I have addedSo you mean always user will add value in the existing value. Because this way will fail in one case. Let say
    Value in Database is = ABCD
    User opened the form and he removed the D and write E and now value is ABCE and length is still same 4. So, there is no addition.
    Anyway you can know the database value at runtime there is one property for item called DATABASE_VALUE. It gives the value which is in database while you are running the form before save. and you can use like this..
    Trigger = WHEN-MOUSE-DOUBLE-CLICK on item level
    DECLARE
      vItemValue DATATYPE; -- Set the data type according to your desired field.
      vValueAdded DATATYPE; -- Set the data type according to your desired field.
    BEGIN
      vItemValue:=GET_ITEM_PROPERTY('ITEM_NAME',DATABASE_VALUE);  -- It will return you the database value in vItemValue variable.
      IF LENGTH(vItemValue)>LENGTH(:FORM_ITEM_NAME) THEN  -- It mean something change or added
        vValueAdded:=SUBSTR(:FORM_ITEM_NAME,LENGTH(vItemValue)+1);
        MESSAGE('Added value is : '||vValueAdded);  -- It will show you the added value.
      END IF;
      -- now suppose you want to show the old and new value in message not the added one
      -- Then no need of IF condition. You can just use message like this
      -- And i would prefer to use like this way
      MESSAGE('Old Value : '||vItemValue||'  New Value - '||:FORM_ITEM_NAME);
      MESSAGE('Old Value : '||vItemValue||'  New Value - '||:FORM_ITEM_NAME);
    END;Hope it is clear.
    -Ammad

Maybe you are looking for

  • Error while posting payroll to accounting

    Hello, In a payroll I have two seperate cost centers with different profit centers. While posting to accounting there is an error "Balancing field profit center not found in line item 001" Please Help. Regards Vijay

  • Time Capsule Contents, Insufficient Privileges?

    Longtime reader, first-time poster so forgive me if I stray from typical conventions.. I recently setup a 1TB (Dual-band) Time Capsule as both the target of my Time Machine backups and my home network's base station. Anywhere from 4-6 devices (at lea

  • Microsoft SQL Server 2008 R2 SP2 - Express Download Link Broken

    Hello there I am installing Backup Exec 2014 and during the installation I need to provide the EXE from the "Microsoft® SQL Server® 2008 R2 SP2 - Express" installer (German version). Unfortunately the link is broken, even when I navigate from the dow

  • Am I even using the correct cd's?

    Hello, I'm a new Mac User so here goes. I have a Mac Book Pro too. I wanted to install Windows XP on my Mac using Boot Camp of course. Now, I've been told that the CD's that came with my Mac wont work when I'll try to install Windows. Is this true? O

  • How do i get the font on my iMac bigger

    how do i get the font on my iMac bigger