How to get dates with respect to System Date?

Hello,
I am trying to get Date value after 30 days of my System current date. I am using
System.out.println(new java.util.Date(System.currentTimeMillis()+30*3600*24*1000));
but I am not getting correct date.
Suppose my system date is 15July then after executing this code I should get 14Aug, but it is giving a date of month June.
Please suggest solution for this.
Thanks,
Niket

This doesn't have anything to do with the Collections Frameworks. You should direct this type of question to "Java Programming".
Here is the code you're looking for anyway...
import java.util.*;
import java.text.*;
public class thirty
    public static void main(String[] args) throws ParseException
     Calendar todaysdate = new GregorianCalendar();
     SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
     System.out.println("today's date: " + sdf.format(todaysdate.getTime()));
     todaysdate.add(Calendar.DATE, 30);
     System.out.println("thirty days later: " + sdf.format(todaysdate.getTime()));
}

Similar Messages

  • Validation of service entry date with respect to po date

    i want to validate the service entrysheet date with respect to Purchase order date.
    service entry sheet should not be before po date(doc date).
    SRVESSR- name of user exit for service entry sheet.
    but it is not triggering ,
    suggest me how to do .
    if sy-tcode = 'ML81N'.
      if i_ekpo-werks = '5000' or i_ekpo-werks = '4000' or i_ekpo-werks = '6000'.
        if C_ESSR-BUDAT  < I_EKKO-BEDAT.
          message 'Service Entry sheet Psting data should not be before PO Date' type 'E'.
        endif.
      endif.

    Hi shaiz.
    Try to under the concept of schduling During MRP run,
    Scheduling will be done  for FG with respect to  scheduling data maintained for FG material. It will not consider the planned delevery time of its child  materail.
    Requirement date is created for FG only, on this date FG should be deliverd to stock.
    u have to plan  raw material to meet requirement date.
    System will not  reschedule FG order automatically if raw delivery time is delayed it will give exception message only to reschedule. You have to reschedule FG order with respect to delivery date of ROH  manually by doing material avilablity check.
    I hope this should have  given some idea
    Regards
    Pradeep

  • Metagen is skipped sometimes complaining because all output files are up-to-date with respect to the input files

    Hi,
    In one of my dll (VS2010), the process Skipping target "MetaGen" because all output files are up-to-date with respect to the input files.
    it is at  random.  I have checked the time stamps of the dll and metagen.write.1.tlog both having the time stamp on the failed build.  But all files in release folder did not have the same time.  They are one hour earlier than the dll
    and the  metagen.write.1.tlog.
    On the good build  it said the input file is is newer than output file ".\Release\\metagen.write.1.tlog" and allfiles in the release folder have same time stamp.
    Any clue to solve this ?
    Regards,

    Hi,
    Based on your post, I am not very clear about your issue. I feel your issue is out of support range of VS General Question forum which mainly discusses
    the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
     Could you please provide us more information so that we resolve your issue better?
    What type of project are you working with? C++ MFC project?
    How was the
    metagen.write.1.tlog file generated in your project?
    What error messages did you get?
    What is the 'input file'?
    If possible, please provide us a sample project to reproduce your issue.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Crystal Reports XI String [255] limit with the File System Data driver...

    I was trying to create a Crystal Reports XI report to return security permissions of files and folders.  I have been able to successfully connect and return data using the File System Data driver as the Data Source; however the String limit on the ACL NT Security Field is 255 characters.  The full string of data to be returned can be much longer than the 255 limit and I cannot find how to manipulate that parameter. 
    I am currently on Crystals XI and Crystal XI R2 and have applied the latest service packs but still see the issue.  My Crystal Reports Database DLL for File System data ( crdb_FileSystem.dll ) is at Product Version 11.5.10.1263.
    Is it possible to change string limits when using the File System Data driver as the Data Source?  If so, how can that be accomplished.  If not, is there another method to retrieve information with the Windows File System Data being the Data Source?  Meaning, could I reach my end game objective of reporting on the Windows ACL's with Crystal through another method?

    Hello,
    This is a known issue. Early versions you could not create folder structures longer than 255 characters. With the updates to the various OS's this is now possible but CR did not allocate the same space required.
    It's been tracked as an enhancement - ADAPT01174519 but set for a future release.
    There are likely other ways of getting the info and then putting it into an Excel file format and using that as the data source.
    I did a Google search and found this option: http://www.tomshardware.com/forum/16772-45-display-explorer-folders-tree-structure-export-excel
    There are tools out there to do this kind of thing....
    Thank you
    Don
    Note the reference to msls.exe appears to be a trojan: http://www.greatis.com/appdata/d/m/msls.exe.htm so don't install it.
    Edited by: Don Williams on Mar 19, 2010 8:45 AM

  • How to get the previous state of my data after issuing coomit method

    How to get the previous state of some date after issuing commit method in entity bean (It should not use any offline storage )

    >
    Is there any way to get the state apart from using
    offline storage ?As I said the caller keeps a copy in memory.
    Naturally if it is no longer in memory then that is a problem.
    >
    and also what do you mean by auditlog?
    You keep track of every change to the database by keeping the old data. There are three ways:
    1. Each table has a version number/delete flag for each record. A record is never updated nor deleted. Instead a new record is created with a new version number and with the new data.
    2. Each table has a duplicate table which has all of the same columns. When the first table is modified the old data is moved to the duplicate table.
    3. A single table is used which has columns for 'table', 'field', 'data' and 'activity' (update, delete). When a change is made in any table then this table is updated. This is generally of limited useability due to the difficulty in recovering the data.
    All of the above can have a user id, timestamp, and/or additional information which is relevant to the data being changed.
    Note that ALL of this is persisted storage.
    I am not sure what this really has to do with "offline storage" unless you are using that term to refer to backed up data which is not readily available.

  • How to get approver with SO in PLD

    Hi expert
      I have an approvel procedure on sales order.
      I would like to get approver in PLD, but how to get them?
      I know the data save in OWDD/WDD1 table, and I can use
      Alt key to pull the all table, but I don't know how to join them well. Have any body meet the sam problem? Any body have the solution?
    Glen

    Hi,
    Please follow the below mentioned steps:
      1. make a UDF on the title level of the marketing document
      2. make a query like this:
        SELECT T3.U_NAME FROM OWDD T0, ORDR T1, WDD1 T2 INNER JOIN
        OUSR T3 ON T2.UserID = T3.INTERNAL_K
        WHERE T1.DocEntry= T0.DocEntry and T2.WddCode=T0.WddCode
        and T1.DocNum=$[$8.1.0]
      3.link the query to the UDF;
      4.add a data field in the print template to make the UDF visible.
    +But,please note that for multi approver scenario,the system does have
    the limitation here that when in these cases, you can display only one
    approver or you have to create several UDF to display the whole
    information.
    Regards,
    Abhinav Banerjee
    SAP Business One Forums Team
    Edited by: Abhinav Banerjee on Nov 22, 2008 2:49 AM

  • Blocking of Good Issue with respect to posting date

    Hi Expert,
                   Is there any way out in SAP B1 to block the Good Release with respect to posting date.i.e. If User receipt the Good in stock today then system should not allow the user to issue the same good on the back date.
    regards,
    PankajK

    Hi Pankaj,
    There are so many options e.g you can check in oinm select that particular item sort on docdate and check inqty and compare with your goods issue date if it is same then send same transaction to approval if you want.
    Thanks
    Sachin

  • How to get physical memory by using system call ?

    how to get physical memory by using system call ?What system call can I use.thanks

    Use sysconf(3C) with SCPHYS_PAGES

  • How do I work with FK in a data profile?

    Hello People:
    I am new in OWB tools and I have many doubts. Therefore, I would like to know if anyone can guide me a bit with the theme of FK and profiles.
    How do I work with FK in a data profile?
    If I have a table that has a FK to most of the tables, because it is like a parent table. What should I do to have that FK in the profile?
    e.g.
    - Table 1 FK Table 2
    - Table 1 FK Table 3
    - Table 1 FK Table 4
    - Table 1 FK Table 5
    - Table 1 FK Table 6
    - Table 2 FK Table 7
    - Table 2 FK Table 8
    - Table 8 FK Table 9
    You should have a data profile with each table or a data profile for all related tables?
    If I am all in a single profile, that it would have no problem but I would only slow every time that I have to add a new table, but if I got separated, I can not use the FK? What is the solution that will give this problem?
    e.g. PROFILE GENERAL
    - Table 1
    - Table 2
    - Table 3
    - Table 4
    - Table 5
    - Table 6
    - Table 7
    - Table 8
    - Table 9
    OR
    PROFILE 1 -> - Table 1
    PROFILE 2 -> - Table 2
    PROFILE 3 -> - Table 3
    PROFILE 4 -> - Table 4
    PROFILE 5 -> - Table 5
    PROFILE 6 -> - Table 6
    PROFILE 7 -> - Table 7
    PROFILE 8 -> - Table 8
    PROFILE 9 -> - Table 9
    OR
    PROFILE R -> Table 1 / Table 2
    PROFILE S -> Table 1 / Table 3
    PROFILE T -> Table 1 / Table 4
    PROFILE U -> Table 1 / Table 5
    PROFILE V -> Table 1 / Table 6
    PROFILE W -> Table 2 / Table 7
    PROFILE X -> Table 2 / Table 8
    PROFILE Z -> Table 8 / Table 9
    Thank you very much for your help!
    Best regard!

    Any idea, please?

  • My Iphone is deactivate, I have photos with out back up, How can I open with out loosing my data.

    My Iphone is deactivate, I have photos with out back up, How can I open with out loosing my data.

    Aussienana wrote:
    OK, so I went and explored  what this site said about Mackeeper. But before I delete it can you tell me:
    If we don't need anti virus program and if the one that came with the machine is supposed to do the job then what does that say about the viruses that Mackeeper says it found? Were they not there and the program made them up? Or were they there and Apple didn't deal with them?
    Thanks for all feedback.
    They were not there and MacKeeper made them up. Delete it completely. I have seen it cripple people's Macs.
    Uninstall MacKeeper
    Pete

  • How to get rozetta with lion?

    how to get rozetta with lion?
    I have put all of Snow Leopard on an external drive (checked to include Rozetta)
    but when I try to use it to start up my computer with Lion installed - it calls this external drive "Recover Drive" and
    it asks me to select from 5 options - all of which sound ominous

    gk5198 wrote:
    I have never used rpm files but Zipeg says it will open them - Zipeg.com
    I'm not really looking for decompressing the rpm, I'm looking for the other features like actually installing the rpm in place. There are a lot of utilities that would just "unzip" the rpm like Unarchiver, etc, but I'm looking for something that will do the rpm install...
    -Thanks

  • How to get the past top 100 match data of game app?

    how to get the past top 100 match data of game app?

    What game app? Have you contacted the developer of the app?

  • How to get the properties of my system ?

    Hi,
    does someone know how to get the properties of my system (like RAM,processor,OS ...) ?
    Thanks, Fred.

    Hi!
    Try this:
    import java.util.Properties;
    public class Props {
         public static void main(String[] args) {
              // This shows all the properties
              System.getProperties().list(System.out);
              // This retrieves a special property
              System.out.println(System.getProperty("java.runtime.name"));
              // Here is to get total system memory
              long totalMemory = Runtime.getRuntime().totalMemory();
              System.out.println("Total memory: "+totalMemory);
              // Here is to get free system memory
              long freeMemory = Runtime.getRuntime().freeMemory();
              System.out.println("Free memory: "+freeMemory);
    }Hope it helps!
    /Andrew

  • ESS Bank Information errors if start date is less than system date

    Hello Developers,
    We are unable to create a new Bank Information record of type "Other"  from ESS Web Dynpro ECC 6.0 when we set the begda field to a date earlier than the system date.  When we attempt this we get the message: "Start date should be after <todays date> or later".
    Is there a configuration setting that will allow new records to be created with the begda set to a past date when creating new "Other" bank type records?
    Our payroll runs bi-weekly and we need to set the beginning date of a new record to the start date of the payroll cycle, which can be earlier than the creation date.
    Thank you

    Terry,
    In transaction SPRO got to Personnel Management>Employee Self Service>Service Specific Setting-->Change Default Start Date
    Business Add-In  HRXSS_PER_BEGDA. You can set the date in the DEFAULT_DATE method.
    Parameters of the method DEFAULT_DATE:
    MOLGA (Importing)
    PERNR (Importing)
    INFTY (Importing)
    SUBTY (Importing, optional)
    BEGDA (Changing)
    Regards
    Sarath

  • ESS Bank Information errors if end date is less than system date

    Hi to all,
    We have create an WD Java aplication to create new entries in infotype 0023. We have used a standar component DC (PersInfo).
    The first problem - we couldn't create new entries if start date is less than system date and we used:
    In transaction SPRO got to Personnel Management>Employee Self Service>Service Specific Setting-->Change Default Start Date
    Business Add-In HRXSS_PER_BEGDA. You can set the date in the DEFAULT_DATE method.
    Parameters of the method DEFAULT_DATE:
    MOLGA (Importing)
    PERNR (Importing)
    INFTY (Importing)
    SUBTY (Importing, optional)
    BEGDA (Changing)
    We have solved the first problem with begda.
    The second problem - we couldn't create new entries if end date is less than system date.
    Can anybody helps me about this second problem?
    Thank a lot.

    Can anybody helps me?
    Thank a lot.

Maybe you are looking for

  • How to change work repository internal ID

    Is it possible to change the ID of existing work repository. Or a new work repository has to be created to get a new different ID.

  • Storm - problems when synching Calendar from Outlook XP

    I wonder if anyone can help with this one?  I should explainthat 've only recently got my Storm back after a total Crash!! When I sync my Storm 9500 with Outlook XP ( having set up for 2 way sync) the Contacts works fine I get 2 way sync. However wit

  • Almost out of computer authorizations

    My hard drive has gone down three times since I started using iTunes several years ago. I have always been able to recover the data and a tech company has replaced my hard drive, but with the latest incident I am told that I have authorized 4 of 5 po

  • Apple mail font changes with mail encoding

    Apple mail will change the font automatically with the encoding of the message. This might not be shown on Apple Mail, but it does when recieved in Microsoft Ouotlook / Windows. When I send in Western Latin 1. font is Calibri Switch the mail encoding

  • Cannot install PS6- windows says quit process: ShellExtLoader

    Just after installation process begins, a window appears telling me to quit a process: ShellExtLoader . I´m using Mac Os Lion in a macbook pro. Activity Monitor does not find any similar process active. Thanks! Pablo