Increasing the date by 30 days

Hello all,
Thanks for taking the time to read this message.
I am getting the date as a string from the registry entry, in this format yyyyMMddHHmmss.
I would like to add 30 days to this again set it in the registry, I know how to set it in the registry, but dont know how i can increase this date by 30 days.
I know how to increase it from the current time ..like this.
new Date(System.currentTimeMillis() + (30L * 24L * 60L * 60L * 1000L));
but dont know how to increase from the taken time.
hope you understand my question.
Thanks

Calendar.add()Thanks for the reply. I have absolutely no idea what
you just said, it would be great if you could give me
an example.Click [url http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html#add(int, int)]here.
Or here...
Calculating Java dates: Take the time to learn how to create and use dates
Working in Java time: Learn the basics of calculating elapsed time in Java
Formatting a Date Using a Custom Format
Parsing a Date Using a Custom Format

Similar Messages

  • How to get the date of first day of a week for a given date

    Hi gurus
    can any one say me how to get the date of first day(date of Sunday) of a week for a given date in a BW transformations. For example for 02/23/2012 in source i need to get 02/19/2012(Sunday`s date) date in the result. I can get that start date of a week using  BWSO_DATE_GET_FIRST_WEEKDAY function module. But this function module retrieves me the  start date as weeks monday(02/20/2012) date. But i need sundays(02/19/2012) date as the start date. So it would be really great if anyone sends me the solution.
    Thanks
    Rav

    Hi,
    The simplest way would be to subtract 1 from the date date which you are already getting in transformation routine, but instead of doing that subtraction manually which might need bit of errort, you can simply use another FM to subtract 1 from given date.
    RP_CALC_DATE_IN_INTERVAL
    Regards,
    Durgesh.

  • How to get the date of 60 days before 1999/03/01?

    Hi, I have a question about Date and GregorianCalendar here. I have a string "1999/03/01" and I would like to know the date that 60 days before 1999/03/01. What should I do it?
    I only went this far:
    DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
    String date = "1999/03/01";
    Date day = dateFormat.parse(date);
    GregorianCalendar calendar = new GregorianCalendar();
    : <--- ??
    So, can anyone please tell me what should I do next??
    -jxchou

    Put this in the search box for this forum at the right: add days +date
    The first 2 hits are about your question.
    The Forum search is your friend...

  • Increasing the date range in generic search

    Hello,
    Is there an easy way to increase the date range in generic search to more than 1 year (the last year option in the dropdown)?
    Our release is ecommerce 7.
    Many thanks
    Stefan

    Check if the BAPI is able to give results for more than a year. If thats possible, add new select options to the jsp of the search view.

  • Why is the data getting eaten up. I had an 8 GB plan since Jan and have done nothing differently since. All of a sudden, my jetpack is using all this data and getting messages saying I am going over my plan. I increased the plan a few days ago and still g

    HELP

    I really wish the forum mods would make it more obvious when it comes to creating post titles vs the content... now we have no idea what we missed out on.
    First of all Jetpacks don't consume data, your personal devices do.  If your data plan is starting to reflect high data usage then one or more of your personal devices are to blame.  That means that for the time being you should get into the habit of powering on and off your Jetpack only as it is needed.  This will curb off the strange or late night download sessions so that they only occur when you are actively using your Jetpack.
    From there its a game of cat and mouse to figure out which device is demanding all the data from the VZW network.  You have to  use isolation techniques in addition to trial and error to find the source of the data leak and put a stop to it.  Sometimes that means bringing the device to a hotspot and letting it finish its updates.  Sometimes that means a new VZW device.  Sometimes that means termination.  Adding more data doesn't help the problem, its a band aid at best.

  • Set flag in DB if the date is 5 days in the past

    I've written some code using SQL that checks today's date and compares is to an entry in the database, which I have called EndDate.  If the EndDate is within 60 days an email will be generated. If data in the database is 60 days or more in the future
    it returns the data from the query.
    Here is the code:
    Use LOGONs
    Select DateAdd(d, DateDiff(d, 0, EndDate), 0) As KeyedDate, Service, Manufactureer, [AccountNumber], GETDATE() as TodayTime
    From ServiceExpiryMAtrix
    where DATEDIFF(d, GETDATE(), EndDate) < 60
    I have created another column in the database called expired, that I'd like to update with either yes or no if the Enddate field is over 5 days old.  The idea behind this is to control whether emails are continued to be sent once the EndDate date has
    passed.
    I have seen that this should be done in the select query but being new to SQL I thought I'd ask the question...
    James
    Alter De Ruine

    This way you don't have to update any column every day.
    Each time you select your table it'll give you the correct value.
    If you want to stick with updating just do this:
    UPDATE LOGONs SET Expired = case when datediff(day,getdate(),[EndDate])>(5) then 'yes' else 'no'  end
    WHERE isnull(Expired,'') <> case when datediff(day,getdate(),[EndDate])>(5) then 'yes' else 'no'  end
    or
    UPDATE LOGONs SET Expired = case when datediff(day,getdate(),[EndDate])>(5) then 'yes' else 'no'  end
    WHERE isnull(Expired,'no') = 'no'
    Then you can set the default value for your column to 'no'  and only update to 'yes'....
    "If there's nothing wrong with me, maybe there's something wrong with the universe!"

  • Getting the date along with day and time on top right of sreen

    I know this sounds stupid, but I can' get the date to show up on the top right hand corner of screen to the left of the speaker icon. With tiger I had a facsimile calendar with the date and time of day on the bottom of my screen next to dock. Very nice. That disappeared with intro of Leopard ... any advice will be welcome. Steve in Phoenix

    This is the standard function and features of the menubar clock in OS X 10.3 thru 10.5.
    You will need to find a third party application to do what you wish.

  • Calculate the date interval in days

    Hi all!
    I need your kind help.
    I have an oracle sql table.
    here is goes..
    TABLENAME: RACE
    DATE NAME
    11-JAN-12 JAMES
    12-JAN-12 JAMES
    14-JAN-12 JAMES
    17-JAN-12 JAMES
    22-JAN-12 JAMES
    01-FEB-12 JOHN
    11-FEB-12 JOHN
    13-FEB-12 JOHN
    14-FEB-12 JOHN
    28-FEB-12 JOHN
    01-MAR-12 JOHN
    HOW DO I Calculate the total date interval(difference) for James and John in days?
    for example in this case the total is 7 days for James(11-JAN-12 to 12-JAN-12 is 0 days and 12-JAN-12 to 14-JAN-12 is 1 day and 14-JAN-12 to 17-JAN-12 is 2 days) and 24 days for John
    The data for the date will be random and can be up to 60 difference dates and names so I will like to calculate for all different names.. Thanks!

    Can you explain in more detail why James should have 7 days?
    Difference in dates can be easily calculated (if you use the DATE datatype, that is) by simply subtracting them.
    Example:
    SQL> -- generating sample data:
    SQL> with race as (
      2  select to_date('11-JAN-12', 'dd-mon-yy') dt, 'JAMES' nm from dual union
      3  select to_date('12-JAN-12', 'dd-mon-yy'), 'JAMES' from dual union
      4  select to_date('14-JAN-12', 'dd-mon-yy'), 'JAMES' from dual union
      5  select to_date('17-JAN-12', 'dd-mon-yy'), 'JAMES' from dual union
      6  select to_date('22-JAN-12', 'dd-mon-yy'), 'JAMES' from dual union
      7  select to_date('01-FEB-12', 'dd-mon-yy'), 'JOHN' from dual union
      8  select to_date('11-FEB-12', 'dd-mon-yy'), 'JOHN' from dual union
      9  select to_date('13-FEB-12', 'dd-mon-yy'), 'JOHN' from dual union
    10  select to_date('14-FEB-12', 'dd-mon-yy'), 'JOHN' from dual union
    11  select to_date('28-FEB-12', 'dd-mon-yy'), 'JOHN' from dual union
    12  select to_date('01-MAR-12', 'dd-mon-yy'), 'JOHN' from dual
    13  )
    14  --
    15  -- actual query:
    16  --
    17  select max(dt)-min(dt) diff
    18  ,      nm
    19  from   race
    20  group by nm;
          DIFF NM
            29 JOHN
            11 JAMESHowever, that is not your desired resultset. We (at least: I) need a bit more explanation why James should have 7 as date difference...
    Also: DATE and NAME ar not suitable as column names.

  • Hardcoding/superimposing the date/time-of-day on to video file?

    Hello,
    I've been working with a Panasonic AVHCD HDC-TM900 camera for a while and I need the date/time to display on my video files when I edit them in the source monitor and to display in the final product.  There is no way to do this on the camera itself (according to Panasonic tech support), however I have found that VLC/Media Player Classic are able to display the information during playback.  I think that it's using the subtitle track to pull the information out of the file, as it appears when I enable subtitles in VLC so I know the info is there.. Is there a tool in Premiere which would allow me to incorporate this information on to my project without having to spit out another file?  Worst case scenario, I would also be open to a solution using Media Encoder as I use it for footage from other cameras but would like to avoid that if possible..
    Thank you in advance for your suggestions,
    AY9999

    I'm not sure if this works for AVCHD, but I know it does for DV: DVdate x64 for Adobe Premiere CS5
    Also, if the above doesn't work for AVCHD directly in Pr, you might look at this: Visual AVCHD Time Stamp

  • How to check  the date with current day after 5 days

    Hello,
    I need to make the visible of delete button in my struts application. I've application in which user can be deactivated. If the user is deactivated and the admin can't delete the user for the specific period of time (set in property file). while deactivating the user, system time is set. and 5 days after the system time's set, i need to make the button visible.
    This is my code.
    Calendar cal = Calendar.getInstance();
    Date deActivatedDate = null;
    deActivatedDate =new Date(userData.getDeActivatedTime().getTime());// Set it in the Calendar object
    cal.setTime(deActivatedDate);                    // Add 5 days
    cal.add(Calendar.DATE, 5);// get the current date
    Calendar currentCal = Calendar.getInstance();
    Date currentDate = new Date();
    currentCal.setTime(currentDate);// check if the de-activation time is over.
    if (cal.get(Calendar.DATE) < currentCal.get(Calendar.DATE)) {
    userData.setDeletionAllowed(true);}
    can anyone help to solve this issue?

    What's the problem with the code that you posted?

  • How to increase the date of expiration

    Hi,
    I have 4.7 version installed at my home PC, it's license has been expired.How to increase its expiry date to future.And also it shows the system date 30-01-2005.
    How can i change it to 30-01-2006.
    Regards,
    Veda Kumar.

    Pick yourself up by your own bootstrap too?
    Reinstall after restoring to HFS only then.
    You want something that works, then spend the $20 on Paragon CampTune or WinClone 3.

  • Increase the data access time in custom development scenarios,layouts etc.

    Hello All,
    We have developed some custom scenario come interface for our Man-hours planning and actual posting. We have also included some validation in them from time to time. Now, it has started taking much processing time during data entry as well as during data saving.
    Kindly suggest how can we reduce this time consumption.
    Thanks & Regards
    Saurabh

    Hi Suarabh,
    If I am not wrong you need to increase performance.
    Use the basis abap standard best practices to acheive this.
    This link can be helpful to you ...
    ABAP Performance and Tuning - ABAP Development - SCN Wiki
    SAP ABAP : best practices - performance techniques | SAP Consulting Development Implementation Remote Support Blog

  • How to get the date of first day of the week

    hi ,
    how can i get the first day of the current week ?
    i have tried the following
    note : my sysdate is 3rd april 2007
    select trunc(sysdate , 'ww') from dual -- 4/2/2007
    select trunc(sysdate , 'w') from dual -- 4/1/2007
    select trunc(sysdate - 4 , 'ww') from dual -- 3/26/2007 -- shld return 25th mar 2007
    select trunc(sysdate - 4 , 'w') from dual -- 3/29/2007 -- shld return 25th mar 2007pls advise
    tks & rgds

    Hi!
    I'm considering MONDAY as the first working day of the current week. And, the code is accordingly --
    SQL> select to_char(sysdate - to_number(decode(to_char(sysdate,'DY'),'TUE','1',
      2                               'WED','2',
      3                               'THU','3',
      4                               'FRI','4')),'dd-mon-yyyy') res
      5  from dual;
    RES
    02-apr-2007Regards.
    Satyaki De.

  • How can I increase the data loading speed

    Hi Expert,
    I need to populate a table cross dblink from another database each night. There are about 600,000 rows. It takes about two hours. This is the steps:
    delete from target_table;
    insert into target_table
    select * from source_table@dblink;
    commit;
    I can't use truncate in case the loading fails that I still have the old data.
    How can I increate the loading speed?
    Thanks!

    DELETE and INSERT /*+ APPEND */ aren't a good combination, as the high water mark will keep going up.
    With a trivial number of rows like this I would not expect the delete or insert to be the problem. (How long does the delete take anyway?) It's more likely to be to do with the query over the db link. Is it just one table or is that a simplified example? Can you check the equivalent insert over on the remote database? If it's much faster I would investigate the network connection.

  • PreparedStatement set date sometimes sets the date one day behind

    I have a PreparedStatement that sometimes sets the date a day behind. I am saving to a MSSQL DB with a field datetime. I have two identical PreparedStatments, one for insert and one for update. When either is executed, it will sometimes set the date back one day. It's not everytime. Every other or every third one, but it's not consistent. Any help would be appreciated.
    ps.setDate(1, Util.parseSqlDate(getParam("CHARGED")));
    public class Util {
         public static java.sql.Date parseSqlDate(String datestr) {
              DateFormat sdf = null;
              if (datestr == null)
                   return null;
              if (datestr.length() > 8) {
                   sdf = new SimpleDateFormat("MM/dd/yyyy");
              else {
                   sdf = new SimpleDateFormat("MM/dd/yy");
              java.util.Date d = null;
              try {
               d = sdf.parse(datestr);
              } catch (ParseException e) {
                   return null;
              if (d != null) {
                   Calendar cal = Calendar.getInstance();
                   cal.setTime(d);
                   return new java.sql.Date(cal.getTimeInMillis());
              return null;
            protected String getParam(String name) {
              return (getParamArray(name)== null) ? null : getParamArray(name)[0];
         protected String[] getParamArray(String name) {
              return (String[])params.get(name);
         }

    traigo wrote:
    The database is a datetime field. Then you should be using the appropriate java jdbc time/date methods to access it rather than strings.
    We are only storing the date portion. Saving with today's date should produce '2009-12-28 00:00:00.000'.
    I just want to set the date to an absolute date (no time value) provided without timezones.Impossible. Since the database datatype is datetime that means that a timezone is always involved.
    And java always uses timezones. Ignoring the problem doesn't make it go away.

Maybe you are looking for