Date half a year from now, how to create?

How can I create a Date () instance which resembles half a year, or 2 months or a year or a day etc. etc. from now?
Thanks!

So, I did something like...
Date now = new Date ();
Timestamp timeStamp = new Timestamp (now.getTime ());
GregorianCalendar calendar = new GregorianCalendar ();
// TODO - FOR NOW WE ADD 60 DAYS TO THE EXISTING TIMESTAMP FOR THE EXPIRY DATE.
calendar.add (Calendar.DATE, 60);
Date expiryDate = calendar.getTime ();
Timestamp expTimeStamp = new Timestamp (expiryDate.getTime ());

Similar Messages

  • How can I add a calendar event into the iphone that will 2 years from now?

    I want to add an event 8 months from now or 2 years from now directly into my iphone without having to scroll endlessly through months. I there any way to do this?

    easiest way would be to repeat the event a year then repeat another year after throught edit
    on date
    normally can repeat
    every day
    week
    2 weeks
    month
    or year

  • SQL select Statement -first day and last day of the month - 1 year from now

    Hi,
    I need to write a SQL to get the dates in between first day and last day of the month one year from now.
    SELECT last_day(add_months(sysdate,12)) as lastday from dual
    What could be the Query to get the first day of the month one year from now..
    ie ..Sysdate - 3-DEC-2009
    Result - 1-DEC-2010
    thank you

    Hi,
    You can use TRUNC with 2 arguments to get the first DATE in a month, year, quarter, week, hour, minute, ISO year, ...
    SELECT  TRUNC ( ADD_MONTHS ( SYSDATE
                               , 12
                  , 'MONTH'
                  )     AS first_of_month
    FROM    dual
    ;The DATE returned will be in the same month, year, quearter, ... as the first argument.
    \We convered the last day of the month in [your previous question|http://forums.oracle.com/forums/message.jspa?messageID=3942939#3942939].
    At that time, I warded about using LAST_DAY as a cutoff point; TRUNC is a much better way.
    For example, to find all appointment_dates in the current month next year:
    SELECT  *
    FROM    appointments
    WHERE   appointment_date >= TRUNC (ADD_MONTHS (SYSDATE, 12), 'MONTH')
    AND     appointment_date <  TRUNC (ADD_MONTHS (SYSDATE, 13), 'MONTH')Note that
    the first part of the WHERE clause calls for dates on or equal to the beginning of the 12th month in the future, but
    the second part of the WHERE clause calls for dates before, not equal to , the beginning of the 13th month in the future.

  • Now how to create a tsql to get best result.

    Hi all
    I have a table that called   voucheritem
    This table has 6 fields
    And my standard value is:
    Rows
    Rules
    Subsidiary
    1ad
    2ad
    3ad
    4ad
    5ad
    1
    Rule 1
    2050  
    103
    207
    396
    452
    509
    2
    Rule 2
    2050
    107
    210
    354
    431
    580
    Row 1 : I want to compare rule1 and the table values (voucheritem), when the values are opposite of each other then show the values
    Row2 : I want to compare rule2 and the table values (voucheritem), when the values are opposite of each other then show the values
    I run this code:
    Select * from
    voucheritem
    Result is
    Rows
    Subsidiary
    1ad
    2ad
    3ad
    4ad
    5ad
    1
    2050  
    103
    208
    396
    452
    509
    2
    2050
    107
    210
    354
    435
    580
    3
    2050
    110
    210
    300
    430
    590
    4
    2050
    100
    207
    396
    452
    510
    5
    2050
    107
    210
    360
    431
    580
    6
    2050
    103
    207
    396
    452
    509
    7
    2050
    107
    210
    354
    431
    580
    see row 1 :
    2ad has 208 value its not equal by rule 1
    row 2: 4ad has  435 value . its not equal by rule 2
     Now how to create a tsql to  get best result.
    Name of Allah, Most Gracious, Most Merciful and He created the human

    Does this do what you were looking for?
    DECLARE @rules TABLE (ruleID INT, subsidiary INT, ad1 INT, ad2 INT, ad3 INT, ad4 INT, ad5 INT)
    INSERT INTO @rules (ruleID, subsidiary, ad1, ad2, ad3, ad4, ad5)
    values
    (1,2050,103,207,396,452,509),
    (2,2050,107,210,354,431,580)
    DECLARE @voucheritem TABLE (voucherID INT, subsidiary INT, ad1 INT, ad2 INT, ad3 INT, ad4 INT, ad5 INT)
    INSERT INTO @voucheritem (voucherID, subsidiary, ad1, ad2, ad3, ad4, ad5)
    values
    (1, 2050, 103, 208, 396, 452, 509),
    (2, 2050, 107, 210, 354, 435, 580),
    (3, 2050, 110, 210, 300, 430, 590),
    (4, 2050, 100, 207, 396, 452, 510),
    (5, 2050, 107, 210, 360, 431, 580),
    (6, 2050, 103, 207, 396, 452, 509),
    (7, 2050, 107, 210, 354, 431, 580)
    SELECT v.*,
    CASE WHEN v.ad1 NOT IN (SELECT ad1 FROM @rules) THEN 'E' ELSE NULL END AS ad1Error,
    CASE WHEN v.ad2 NOT IN (SELECT ad2 FROM @rules) THEN 'E' ELSE NULL END AS ad2Error,
    CASE WHEN v.ad3 NOT IN (SELECT ad3 FROM @rules) THEN 'E' ELSE NULL END AS ad3Error,
    CASE WHEN v.ad4 NOT IN (SELECT ad4 FROM @rules) THEN 'E' ELSE NULL END AS ad4Error,
    CASE WHEN v.ad5 NOT IN (SELECT ad5 FROM @rules) THEN 'E' ELSE NULL END AS ad5Error
    FROM @voucheritem v
    LEFT OUTER JOIN @rules r
    ON v.ad1 = r.ad1
    AND v.ad2 = r.ad2
    AND v.ad3 = r.ad3
    AND v.ad4 = r.ad4
    AND v.ad5 = r.ad5
    WHERE r.ruleID IS null

  • HT1386 I have formated my computer many times without deauthrization of itunes and used deauthrize all pcs once in this year. Now how to deauthrize my computer because i have used all my 5 authrizatons on same computer and not able to authrize my new pc

    I have formated my pc many times without deauthrizing itunes. I have already used deauthrize all computers once a year. Now again i used all authrizations on the same pc due to fomating of the pc 5 times. Now how to deauthrize a formated pc.

    If you need to authorize your new computer and are unable due to already having five authorized computers, you can deauthorize all computers by doing the following:
    Click iTunes Store on the left side of iTunes.
    If you're not signed in to the store, click the Account button, then enter your account name and password.
    Click the Account button again (your Apple ID appears on the button), enter your password, and then click View Account.
    In the Account Information window, click Deauthorize All.

  • Buy now or a year from now?

    I am planning on moving to a MacBook when I begin taking Advanced Computer Programming courses next year (as in Calendar year). I want the MacBook for it's superiority over my old Windows laptop, and for the fact that I am in love with Apple hardware.
    Here is my predicament. I can buy a MacBook ASAP, or buy when I need it the most, around August of 2008. This would give me the chance to buy the most recent MacBook for that school year, and give me the chance to see how people react to Leopard. Now, I'd REALLY like to have one as soon as possible, who wouldn't? But, is it really worth the wait to buy the newest models?

    First off, no one's going to react to Leopard in August, because it's coming out in October. Second, no, it's not really worth the wait to buy the newest model. If you always wait for the latest and greatest to come out...well...you'll always be waiting. That's just how Apple is. In fact, my friend bought her MB 15 days before the C2D ones came out - she missed the return deadline by a single day. Oh well...she's happy with hers how it is.
    I suggest, since you want it now, buy it now. They recently updated the MB line with faster processors and more memory for the base model, so now is the best time to go for it. They seem to be updating the MacBooks every half year or so, so you can wait until November-ish, by which time your MB-needing peak has passed, or you can buy now. I think you should buy it now - you really won't regret it. I promise

  • Data present in  internal table, now how to open it in PDF format

    Dear Friends,
    my Scenario is..
    I have uploaded a pdf file in my database table through  GUI_UPLOAD. It is uploaded.
    Now when user click on some button then that file should be displayed again in pdf format directly.
    (No download to user PC using GUI_download or something)
    DBtab ZTST_XL Format
    MANDT     MANDT     CLNT     3
    KEYA     CHAR5     CHAR     5
    KEY2     INT4     INT4     10
    LENGTH     INT2     INT2     5
    DATA          LCHR     1000
    I brought that data again in my internal table by 
    SELECT * FROM ZTST_XL
        INTO TABLE DBTAB
        WHERE KEYA = 'TEST'.
      LOOP AT DBTAB.
        ITAB-DATA = DBTAB-DATA.
        APPEND ITAB.
      ENDLOOP.
    Now I need to open this PDF file in normal format as it opens usually rather than downloading it on users PC .
    Any Help regarding this will be very much useful
    Thanks & Regards,
    Sourabh

    >
    Sourabh Jain wrote:
    > Dear Suhas,
    > Sorry for Confusion,
    > Actually I was trying to say that ,, I have already uploaded that pdf file to my database table on click of first button,
    > now on click of second button I have to show/open that uploaded pdf file.
    So you just want to show the PDF file you have uploaded to the DB on click of the 2nd button.
    Now you can use the method CL_GUI_FRONTEND_SERVICES=>EXECUTE for this after the user clicks the 2nd button
    CALL METHOD cl_gui_frontend_services=>execute
          EXPORTING
            DOCUMENT              = lv_document "The filepath you have used for GUI_UPLOAD
          EXCEPTIONS
            cntl_error             = 1
            error_no_gui           = 2
            bad_parameter          = 3
            file_not_found         = 4
            path_not_found         = 5
            file_extension_unknown = 6
            error_execute_failed   = 7
            synchronous_failed     = 8
            not_supported_by_gui   = 9
            OTHERS                 = 10.
    Hope i am clear.
    BR,
    Suhas

  • Fate of SD 3-4  years from now

    HI gurus,
    I am an SD consultant with good ABAP Knowledge..
    Can u suggest me what might the demand for SD 3-4 years down the lane( keeping the increasing people flow into SD JOBS in mind)
    If SD is not good ,, then wht module must we switch to
    Does it make sense for us to move into SCM or SEM??
    Suggest me a module in which SD experience also plays a role ........
    Edited by: kode babu on Feb 14, 2008 7:54 AM

    Dear Lakshmipathi,
    these are some of things shared on the community what i witnessed since many topics were around depending areas of specialization.
    1)SDN > 8.5 Lakh users
    2)BPX > 1.5 Lakh Users
    3)Intelligroup on top interms of contributions
    4)Main focus was on the Netweaver technology and ESOA architecture.
    5) were hightlighting the importance of Adobe forms, visual composer and web dynpro's : Composite application frameworks.
    6) During common discussion the SAP practice heads of Intelli, Infosys,Cognizant were present along with Prashant - of CIO reinvented(I became a fan of this guy).
    they were highlighting the importance of
    1) a Sharing culture
    2) how SDN ca help you gear up for future demands
    3) NTW & ESOA
    4) Consumerization
    5) IT services as products and how as an individual can you delivery business services to customer.
    6) Looking for techno business analysts.
    7) Help the customer understand how 4.6 or 5.0 or ECC 6.0 can make difference to him for the same order to cash scenario for example. The technological difference.
    These few thing which i could recollect.
    regards
    sadhu kishore

  • IPhone in Europe 2 years from now

    I am living in the US and am considering the purchase of an iPhone. However, I may need to move to Europe within the next two years. It looks like I'll have to pay the early termination fee of $175 if we move before the service plan has expired but my question pertains to service in Europe afterward.
    Will the iPhone function with a service provider other than AT&T? An AT&T sales rep yesterday was negative: the phone has been locked and will not function with a carrier other than AT&T. Can somebody confirm or deny this? Is it written somewhere?
    Thanks,
    W. Spiff

    It looks like nick638's answer is closest to the truth at this point. Nobody knows what will happen. Today I talked to an online apple sales rep and he admitted they don't know.
    Selling the US iPhone on Ebay sounds like a decent idea.
    If now those AT&T folks would let me get out of the contract if I have to leave the country before the contract expires.

  • What happens when I join Creative Cloud years from now?

    Our company has CS6 now and don't feel it's in the books to join Creative Cloud at this point. What happens when we have to join 1 year to 1.5" down the road? Will we have to pay a penalty fee or do we just join at the $69.99/seat team price?

    MAS ART, There is not penalty fees for not joining Creative Cloud subscription. You are free to join it later. Its just that the membership plans may be different then.

  • Old computer crashed, restored data to new computer from Carbonite, how do I restore bookmarks?rt my bookmarks from carbonite?

    My old computer crashed. Fortunately I had Carbonite and was able to restore my data to a new computer, but I have not been able to import or restore or transfer my bookmarks.
    I went Bookmarks/Show All Bookmarks/Import & Backup, then tried both "Restore." The Restore showed several dated backups but in spite of the message "This will replace all your current bookmarks" it did not. Next time around I tried: "Import Bookmarks from HTML." But I could not find where the the bookmark folder was located.

    The reason behind the above questions is that, if you started Firefox before restoring your backup, you probably have a differently named settings folder (Firefox profile folder).
    I'm going to assume for the moment that your Carbonite restore used the same folder paths you had on your old Windows 7/Windows Vista computer. If it was a Windows XP computer, the following won't lead you to the right place.
    To find other settings folders, try the following. From within Firefox:
    Help > Troubleshooting Information > "Show Folder" button
    This is your currently active folder. Navigate up a level to the Profiles folder. Do you see other folders? Do any of them have recent .json backups in their bookmarkbackups folders? This would be where to point the Restore dialog to get your bookmarks.

  • When materials are returned from customer how to create gate entry ?

    I need to create gate entry for customer return materials before doing PGR. Is there any process available in SAP?
    Pls help
    Jaya

    HI
    you can do one thing
    At the time of doing PGR create a new output type and design smart form / Script based on client requirement and take the print out at the time of PGR
    and also if you want to check the stock for Return material you can track in the system by using MB51 you can find out rather than doing manually because one if you done PGR means you received the Stock
    if i am wrong please correct me
    Regards,
    Prasanna

  • How to create an album based upon date of importing photos

    today i imported over 2000 photos with dates accross three years time frame. how can i create an album based upon the date i imported the photos? or can i.
    if not, how would i add these pix to a specific album without going through the whole library some 15,000 photos strong now?

    Check out the Film Rolls ->
    View -> Film Rolls
    Each import creates a Roll, so the most recent one's should be easy to find. Select all and make an album from them.
    Regards
    TD

  • Date after 3 years...function module needed

    Hi
    i need to find the date after 3 years from today. please let me know how (function module or class) to do this.
    thanks

    hi,
    <b>
      Use this function module.
    RE_ADD_MONTH_TO_DATE
    old date = sy-datum ( any date u want ).
    months = 36</b>
    <b>U can also use other FM</b>
    Date Manipulation
                SD_DATETIME_DIFFERENCE
                 DAYS_BETWEEN_TWO_DATES
                 MONTHS_BETWEEN_TWO_DATES.
                 RE_ADD_MONTH_TO_DATE
                 CALCULATE_DATE
                 HR_JP_MONTH_BEGIN_END_DATE
                  LAST_DAY_OF_MONTHS
                  ADD_TIME_TO_DATE
    CONVERT_DATE_TO_ALPHA_NUMERIC
    PERIOD_AND_DATE_CONVERT_OUTPUT
    CONVERSION_EXIT_LDATE_OUTPUT
    DATE_TO_DAY
    CCM_GO_BACK_MONTHS
    SD_DATETIME_DIFFERENCE
    Give the difference in Days and Time for 2 dates
    FIMA_DAYS_AND_MONTHS_AND_YEARS
    Get number of days. Year, Months between two dates.
    <b>
    Mark Helpfull Answers</b>
    Regards
    Message was edited by: Manoj Gupta
    Message was edited by: Manoj Gupta

Maybe you are looking for

  • Custom javascript functions in mobile webdynpro for java

    Hi We are developing an application for hand scanners. But the client uses different kinds of scanners. For this purpose we have to create some custom java script functions. Can anyone share your experiences on this with us which can guide us in the

  • Advanced Album Art Question

    (At least I think it's advanced, since I can't figure it out - haha). Anyway, I was wondering if album art can be assigned to an album as a whole, as opposed to just the individual songs. Here's what I'm doing. This past year Weird Al Yankovic releas

  • How can I take minutes from mysql date format

    how can I take minutes from mysql date format?? example 10:30:00 is stored in my sql and I want to create 3 variables which will store hours, minutes and seconds.. Cheers..

  • I need to open the odd PDF what would the product for me

    I need to open the odd PDF what would be the product for me

  • (V7.3) PARTITION VIEWS IN RELEASE 7.3

    제품 : ORACLE SERVER 작성날짜 : 2004-08-13 SCOPE 8~10g Standard Edition 에서는 Partitioning Option 은 지원하지 않는다. 1. 소개 Partition view 는 Oracle Release 7.3 에서 대용량 테이블(예를 들면, data warehousing에서 주로 사용함)을 지원하기 위해서 추가된 새로운 방법이다. Partition View는 대용량 테이블에 대한 관리성 및 가용성