How to get next day predicition

In data mining i have adventure DW ,  i need to create mining structure with predicition on next day or next week or next month.
please help me its importand me ...
thanks 
Pandiyan

Here's a working example:
import java.util.Calendar;
import java.text.SimpleDateFormat;
public class Tomorrow {
    public static void main(String[] args) {
        Calendar c = Calendar.getInstance(); // current date
        c.add(Calendar.DAY_OF_MONTH, 1); // add one day
        SimpleDateFormat sdf = new SimpleDateFormat("dd"); // use the pattern: day_of_month
        String str = sdf.format(c.getTime()); // fromat the date to string
        System.out.println(str); // print it at the console
}You should read the [url http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html]Calendar and [url http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html]SimpleDateFormat class javadoc.

Similar Messages

  • How to get next day date (i.e., tommarow's date) from java

    Hi all,
    One small help plz..........
    Which is the method to get next day date(for eg: 2mmarow)....
    How can I get tommarow's date from Date class or some others in Java..
    Iam able to get today date.....but my requirement is I should get next day date....Plz help me....
    Plz help me.....
    Any help will be appreciated...
    Thanks a lot.....~!~!

    Here's a working example:
    import java.util.Calendar;
    import java.text.SimpleDateFormat;
    public class Tomorrow {
        public static void main(String[] args) {
            Calendar c = Calendar.getInstance(); // current date
            c.add(Calendar.DAY_OF_MONTH, 1); // add one day
            SimpleDateFormat sdf = new SimpleDateFormat("dd"); // use the pattern: day_of_month
            String str = sdf.format(c.getTime()); // fromat the date to string
            System.out.println(str); // print it at the console
    }You should read the [url http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html]Calendar and [url http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html]SimpleDateFormat class javadoc.

  • How to get same day of a month in every year in the DB ( To update a flag )

    Hi,
    I am trying to formulate an update query for a flag table in our database which contains dates, and flag columns. Currently the system have dates for the next ten years. The flags are updated with values 0 or 1 if a particular date falls under the required criteria.
    I need to update flag column for the same day of the month in every year. e.g. 2nd Sunday of October. The value should be updated to all years in the table. Currently I am using the following query to update the current year.
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7;
    and for next year Like
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = add_months(NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7,+12)-1;
    This is not an excellent way to do it as it does not take care of leap years and it does not scan and update values in the whole table for all years correctly.
    Can any one help me to resolve this please.

    Hi,
    user10903866 wrote:
    Hi,
    I am trying to formulate an update query for a flag table in our database which contains dates, and flag columns. Currently the system have dates for the next ten years. The flags are updated with values 0 or 1 if a particular date falls under the required criteria.
    I need to update flag column for the same day of the month in every year. e.g. 2nd Sunday of October. The value should be updated to all years in the table. Currently I am using the following query to update the current year.
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7;That's the 2nd Sunday after October 1; the 2nd Sunday of October is the 2nd Sunday after September 30, so you need to subtract 1 more day before calling NEXT_DAY.
    I'd do it this way:
    WHERE   c_date = NEXT_DAY ( TO_DATE ( '01-OCT-2013', 'DD-MON-YYYY') - 8
                             , 'SUNDAY'
                     ) + (7 * 2)     -- Last number is week numberRemember, calling NEXT_DAY like this depends on your NLS_DATE_LANGUAGE.
    and for next year Like
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = add_months(NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7,+12)-1;If you want the 2nd Sunday in October, 2014, then take the previous expression, and just change 2013 to 2014:
    WHERE   c_date = NEXT_DAY ( TO_DATE ( '01-OCT-2014'     -- or any month and year you want
                                        , 'DD-MON-YYYY'
                            ) - 8
                             , 'SUNDAY'
                     ) + (7 * 2)     -- Last number is week number
    This is not an excellent way to do it as it does not take care of leap years and it does not scan and update values in the whole table for all years correctly.
    Can any one help me to resolve this please. 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ {message:id=9360002}

  • How to get last day of prev month?

    SELECT to_char(SYSDATE, 'MM') -1, last_day(sysdate)
    FROM DUAL;
    If current month is April, How to get the last day of March? Thanks.

    SQL> select sysdate, trunc(sysdate, 'mm') - 1 from dual ;
    SYSDATE     TRUNC(SYSDA
    06-APR-2004 31-MAR-2004
    1 row selected.
    SQL>

  • How to get previous day of the date

    Hi,
    for a given date I need one day minus as a result date
    my input would be any date
    for example :
    Input Date : 2006-03-22 ( yyyy-mm-dd)
    Output should be : 2006-03-21
    If my input is 1st of April 2006, output i would expect is 31st March 2006
    Please suggest how to achieve this
    Thanks in advance
    Nilesh

    Find below the code to get previous day of the current date
    import java.util.Date;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    public class PreviosDay
    public static void main(String[] args)
    DateFormat dateFormat = new SimpleDateFormat( "MM/dd/yyyy");
    Calendar cl = Calendar.getInstance();
    // you can use a Date object's getTime() method , which is initialiazed
    // to desired date here directly ex: Date dt = new Date("10/10/2004");
    // cl.setTimeInMillis(dt.getTime());
    cl .setTimeInMillis(System.currentTimeMillis());
    cl.add(Calendar.DAY_OF_MONTH, -1);
    System.out.println("Previous date : "+dateFormat.format(
    new Date(cl.getTimeInMillis() ) ) );
    }

  • How to get the day as numeric value without formatting the date?

    Hello,
    to reduce the costs of a sql-statement I need to get the day of a date-value as number (to compare it to a numeric value) without any formatting. Every formatting results in a full table scan of the table with the date field. Is there any function to solve this problem?
    Oracle version is 11g.
    Thanks Carsten

    CarstenDD wrote:
    select T1.SYSID from T2,T1
    where T2.SysT1 = T1.SYSID
    and T2.Date1 < '01.03.2011' --German date format
    and to_number(to_char(T2.Date2,'DD')) = 1
    and T2.Inactive = 0
    The explain plan shows a full table scan on T2. With EXTRACT(DAY FROM T2.Date2) there is no difference.It probably would and should in any case.
    Look at your predicates, which of them would reduce the resultset to a fair size compared to the total number of records in the table?.
    - You may have a huge number of records when you say date less than
    - Of these perhaps one seventh have day = 1
    - My guess is that most have Inactive = 0
    Besides, you should not rely on implictit char to date conversion, always use TO_DATE
    How many records are in the table? - How many will that query return?
    Regards
    Peter

  • How to get one day back data from selecting date .

    Hi Experts,
                   Iam using DB2 database .How to see one day back of selected date . i tried by using prompts .
    Date=(@prompt('Mssg','D',,mono,free)-1 days)   Date is a date object and i applied prompt for date . butting i'm facing error . so kindly help me to over come this issue .
    Regards
    Dinesh

    first capture Date on univers by simply using your formula
    Date=(@prompt('Mssg','D',,mono,free))
    Now to get the previous date i.e 1 day back date
    create another variable called
    back_Date = (Date - 1 Day)
    Thanks,
    Swapnil

  • How to get Privious Day data in OBIEE

    Hi experts i need to get preivious day data(Rating Given by Bank to a customer). Because this data (rating) is not an measure so i can't use AGO function.
    So please suggest me how can i Get this without using AGO function.
    Thanks in Advance
    Regards
    Frnds

    Hi..
    yes, need to do as naresh said..
    but in filter you need to assing this..
    Apply filter on your date column
    and click on convert this filter to SQL option..
    here you need to assign the code given by naresh..
    like..
    your datecolumn =*timestampadd(sql_tsi_day,-1,daycolumn)*
    likewise, you get.. but this gives you only previous day data as you asked..
    Thanks & Regards
    Kishore Guggilla

  • How to get last day of the year

    Hi All ,
    Thanks in advance ...
    How will I get the last day of the year as I am passing date at run time .
    I can manage to get first day of year by
    SELECT TRUNC(SYSDATE,'YEAR') AS FDAY_YEAR
    from dual
    Thanks in advance
    Regards
    Sachin

      1*  select ADD_MONTHS(trunc(sysdate,'yyyy'),12)-1 dd from dual
    SQL> /
    DD
    31-DEC-2010

  • How to get the day value from the current time?

    Hi,
    I like to write a program that prints out the current time in the formate as "Thu May 3 07:57:02 PDT 2002". Then I want to get the day, time, year and month value out and do some manipulation.
    I know to format the current time, I can use
    SimpleDateFormat formatter
    = new SimpleDateFormat ("EEE MM.dd hh:mm:ss z yyyy");
    Date currentTime_1 = new Date();
    Now how do I get the day, time, year and month value? All the getday(), gettime()..,method have been deprecated. Can anyone provide the answer?
    Thanks.

    Try using Calendar.get(int) and take a look at the constants used to specify the field you are trying to access.

  • How to get next batch of mails from GMail?

    Hello,
    I can not get next batch of mail from Gmail. I thought how this is question for gmail but they have respond me this:
    "Thanks for your interest in Gmail and in Google. Because we're testing Gmail, there is some information we're unable to share."
    Does anyone can tell me how to do this?
    Thanks in advance!
    Best Regards,
    Nikola Putnik

    You cannot

  • How to get NEXT free NUMBER for EXTERNALLY assigned RANGEs - SNUM, MD91 ?

    Hi Experts,
    I know that, with the FM - NUMBER_GET_NEXT_V1, I can get the next # for most document #s.
    But, this FM is ONLY applicable to INTERNAL NUMBER RANGE.
    1 - But., am working with EXTERNAL NUMBER RANGE, so looking forward for a FM/BAPI, which gives me next free # for use.
    2 - If nothing is there, How to get it done? Is directly grabbing the latest # from the table/data base?
    3 - Any other ideas?
    thanq

    For an example
    Look at Attributes for SAP function ' L_TO_CONFIRM_SU' . Observe the radio button 'REmote-enabled function module - 2nd one.
    Then you can see under source code it calls other SAP FMs. This is where you call the SAP FM you found.
    A remote enabled fm requires a Logical destination when called from a program- you might already know that.

  • How fast is next day shipping really?

    Ok, so I ordered my rMBP on the 18th and it delivered yesterday, but heres the problem, when it showed up to my house it was smashed to **** (I'd post pics buy I don't know how). The bottom literally looked like it was beaten with a hammer. Anyway, I got in the phone with apple and the sent out a replacement and a free case with next day shipping. The order says ships in 5-7 days, naturally, and the delivery estimates are August 13th - 15th, however, I am moving on the 13th. Should I reschedule my moving day or does anyone think my computer could come before? I know this is u2u, but has anyone had a similar experience, or can let me know about the shipping? Thanks in advance, and please if you don't have an answer don't post a snide remark.

    No sarcasm here.
    One Apple gives it to the shipper, you rely on the shipper to have all export/mport aggreements in place, that no trucks or planes have mechanical issues, or other unforeseen events.
    Most Apple products come otu of China, so export/import is big concern.
    My refurbished MB only traveled within the US from what I can tell.

  • How to get previous day data if i dont have current day data.

    Hello Gurus,
    I have a stock levels data in ODS. when there is no movements, we are not getting any stocks into ODS. So we have to get previous day data as it is for current day data into another ODS.
    Could you please help me in this regard.
    Thanks in advance,
    Rama

    Rama -    
            0CALDAY can't help us in this scenario .
    Step 1 :
        To do this - You have to add one ZDATE (InfoObject ) to 1st ODS. ZDATE is updated by itself from current date of system  when ever you are loading data to 1st ODS.
    Step 2:
       You have to do full update to 2nd ods.At the selection screen of InfoPackage  (from 1st ODS to 2nd ODS ) you have to write following code for ZDATE.
    pseudo Code:
    1) Select fields "Rec_INSERT","Time stamp","Request Status" and "Request ID"  where ICUBE = ODS1 from table "RSMONICDP"
    2) Populate above selected fields data in INTERNAL TABLE
    3) Sort INTERNAL TABLE by Time stamp .
    4)
         If (Record Count = ' 0 ' for current date in internal table )
         update records from  ODS1 to ODS2 where ZDATE = "yesterday date"
         else
         update records from ODS1 to ODS2 where ZDATE= "today date"
         endif.
    Make sure this is full update not delta update from ODS1 to ODS2
    I am sorry, I m not good in Coding but I am sure if  u use this logic,You can meet your requirement.
    I hope you can understand my logic. Let me know if you have any questions,
    Anesh B .

  • How to get Last Day of a Previous Month

    Hi all,
    I need to get Last Day of the Previous Month. I am able to get Current Month Last Day using Calendar.getActualMaximum(Calendar.DATE)
    But I need previous Month's Last Day.
    Thanks
    Vamshi.

    Thanks all....
    I have been trying the same and could get it.....
    here is the code for that....
    SimpleDateFormat simpleDate = new SimpleDateFormat("MM/dd/yyyy");
    Calendar calendar = Calendar.getInstance();
    month = calendar.get(Calendar.MONTH);
    //year = calendar.get(Calendar.YEAR);
    calendar.set(Calendar.MONTH, month-1);
    calendar.set(Calendar.DATE, calendar.getActualMaximum(Calendar.DATE));
    //lastDayOfMonth = calendar.getActualMaximum(Calendar.DATE);
    System.out.Println("Previous Month End Date is :: " + simpleDate.format(calendar.getTime()));
    this works....
    thanks for ur replys....

Maybe you are looking for

  • Possible to upgrade x131e screen to HD+?

    I knwo from experience that ThinkPads are generally easy to work on, I've got a T510, a W530 and a little x131e on the way... I've read on a few forums and seen pictures proving that people had upgraded their E-series and other ThinkPads that came wi

  • Working with excel files in C#, in a web farm

    I am creating a excel file uploader that after the upload, searches for specific columns, saves data to SQL Server, then gets rid of the excel file. I will be accepting .xls & xlsx file types.  The internal file structure should be all fairly standar

  • Open PDF 1.4 in Acrobat 9 and save as 1.4

    I am trying to resolve an issue where when I open a PDF in Acrobat 9 and then close the file after changes it will take a PDF 1.4 and make it a PDF 1.5. Is there any way to have Acrobat save the PDF files as the same version as was opened, by default

  • Invoking a call to a window executable fails when request output to file

    Hi, When invoking a call to a window executable it fails(returns 1 instead of 0) when requesting output to file by using "> filename.txt". This nornally works when run directly within a windows command prompt, and it also works if I don't add the ">

  • Purchase Order Enhancement

    <Subject line modified> Dear Friends, I am trying to put a validation like.. When i use Document type(ZB-service PO),if it is has any item with "Returned" indicator means..for that line item the stock type should come as"Unrestricted Stock"by default