How to find the day of a particular date

Hi,
I am working on an app which will display 15 days in retrospect with the date and day for any entered date. For example if the user enters June 15, 2001 the app has to display dates from June 1 and the corresponding day of those dates like sunday, monday... Is there any function which would help me.

use the java.text.SimpleDateFormat and java.util.Calendar classes
// look at the javadocs for SimpleDateFormat for mor info about the formatting
// string that is passed to the constructor
// the format below translates to : "Fri, Aug 17, 2001"
SimpleDateFormat formatter = new SimpleDateFormat ( "EEE, MMM d, yyyy" );
Calendar cal = Calendar.getInstance();
Date theDate = new Date();
cal.setTime( theDate );
for ( int i=0; i<15; i++ ) {
    String dateStr = formatter.format( cal.getTime() );
    System.out.println( dateStr );
    cal.add( Calendar.DAY_OF_YEAR , -1 );
}output of this code:
Fri, Aug 17, 2001
Thu, Aug 16, 2001
Wed, Aug 15, 2001
Tue, Aug 14, 2001
Mon, Aug 13, 2001
Sun, Aug 12, 2001
Sat, Aug 11, 2001
Fri, Aug 10, 2001
Thu, Aug 9, 2001
Wed, Aug 8, 2001
Tue, Aug 7, 2001
Mon, Aug 6, 2001
Sun, Aug 5, 2001
Sat, Aug 4, 2001
Fri, Aug 3, 2001

Similar Messages

  • How to know the day of a given date?

    Hello Experts,
    Is there any function module that can give the day of a given date? For example, If
    I put in 10/30/2007, it will give me Tuesday. Hope you can help me guys.Thank you and take care!

    Hi
    Yes, DATE_COMPUTE_DAY
    Sample code:
      clear: hold_day_of_week.
      CALL FUNCTION 'DATE_COMPUTE_DAY'
           EXPORTING
                DATE = workdate
           IMPORTING
                DAY  = day_of_week_num
           EXCEPTIONS
                OTHERS  = 8.
      CASE day_of_week_num.
        WHEN 1.
          hold_day_of_week = 'Monday'.
        WHEN 2.
          hold_day_of_week = 'Tuesday'.
        WHEN 3.
          hold_day_of_week = 'Wednesday'.
        WHEN 4.
          hold_day_of_week = 'Thursday'.
        WHEN 5.
          hold_day_of_week = 'Friday'.
        WHEN 6.
          hold_day_of_week = 'Saturday'.
        WHEN 7.
          hold_day_of_week = 'Sunday'.
        WHEN OTHERS.
          hold_day_of_week = 'invalid'.
      ENDCASE.
    or 
    You can use  DATE_COMPUTE_DAY to get the day number of the week (for example, today gives 5)
    then use WEEKDAY_GET which returns an itab with seven entries (one for each day of the week.)
    You enter in this itab and get the field langt to get the day name.
    code @ http://www.sap-img.com/abap/fm-to-get-the-day-for-a-particular-date.htm
    Pls reawrd points

  • Find the 'DAY' for a given 'DATE'

    Hi Folks,
    I need a help regarding finding the day for a given date.
    My requirement is that..,
             If I enter a date using 'parameters', it should write the 'day' for the corresponding date.
    To be more specific.....,
    if I enter date as ' 07/15/2008 ' it should return me  the day as 'Tuesday'.
    Regards,
    Naveen G

    HI,
    FM LIST WITH RESPECT TO DAY, WEEK, AND MONTH.
    CALCULATE_DATE : Calculates the future date based on the input .
    DATE_TO_DAY : Returns the Day for the entered date.
    DATE_COMPUTE_DAY : Returns weekday for a date
    DATE_GET_WEEK : Returns week for a date
    RP_CALC_DATE_IN_INTERVAL : Add days / months to a date
    MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
    END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
    HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
    FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
    MONTH_NAMES_GET : Get the names of the month
    WEEK_GET_FIRST_DAY : Get the first day of the week
    HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format
    SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
    L_MC_TIME_DIFFERENCE : Find the time difference between two date/time
    HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months
    LAST_DAY_OF_MONTHS : Returns the last day of the month
    DATE_CHECK_PLAUSIBILITY :Check for the invalid date.
    Reward points if useful,
    siri

  • How  to find the definintion for a particular implementation

    hi
    ihave the implementation name so i put this in se19
    and after enter it asks for definition which has to be created in se18
    if we have some predefined definitons  already for that implementation
    how to find the particular definiton that is to be used

    Put that implementation name in the enhancement name option of SE18 and press display. I hope by implementation you dont mean the Z Include.
    If it is Z include then look for where use list of that and pick the Enhancement name from there.
    Regards,
    Amit

  • How to find the day of the week ?

    Hi,
    I want to find the day of the current date. Can you please let me know as to how to get the same ?
    My code is like :
    java.util.Date date = new java.util.Date();
    // Here i need to use a method to retrive the day of this date
    Your early input is appreciated.
    Regards

    Use a java.util.GregorianCalendar:
    GregorianCalendar calendar = new GregorianCalendar();
    System.out.println("DAY_OF_WEEK: " + calendar.get(Calendar.DAY_OF_WEEK));

  • How to find the location of a particular font in the framemaker book?

    Hi All,
    please help me in finding the location of a particular type of font in the framemaker book. I was using the following procedure to find out earlier:
    Find > Character Format > (set the character format) > Search.
    Now I am unable to locate a particular type of font using the mentioned procedure.
    Please help me out.
    Thanks in adnavce,
    Mindevil

    This assumes that the font instance being searched for is an override:
    Click in some text in one of the book files.
    Edit > Find/Change
    [ Character Format ...]
    This pops up a Character Format dialog.
    Assuming you are on Windows:
    [Ctrl]+[Shift]+[F8] to set everything to As-Is/blank.
    In Family:, select the font being sought. [Set]
    Back in the Find dialog...
    Look in: <*> Book
    [Find]
    If the font instance is part of a Paragraph Format or Character Format, you can search by Para Tag name or Char Tag name (which is yet another reason why overrides are a problem).
    Or you can save out all the book files as MIF and search with a plaintext editor, but that requires a nominal knowledge of MIF.
    I might add that steps 1-3 above are covered in FM7.1 Help (and presumably the printed manual back then), but are absent for FM9, and I'm guessing that they never returned in later versions either.

  • How to find the Day on a Week for any given Date

    Hi..... I need your help to find out the Day on a Week for any given Date .
    Say if the Date is 31/12/2009 , what would be the Day on a Week for this Date.
    Are there any fucntions available to determine the same?
    Please let me know....Thanks in Advance
    Regards
    Smita

    Hi ,
    You can using the following peice of code to get the Day of a Week for the given date :
    Calendar now = Calendar.getInstance();   
    System.out.println("Current date : " + (now.get(Calendar.MONTH) + 1)  
         + "-" + now.get(Calendar.DATE) + "-" + now.get(Calendar.YEAR));
    //create an array of days  
    //Day_OF_WEEK starts from 1 while array index starts from 0        
    String[] strDays = new String[]{"Sunday",  "Monday", "Tuesday", "Wednesday",  "Thusday",   "Friday",  "Saturday" };   
    String day_of_week = strDays[now.get(Calendar.DAY_OF_WEEK) - 1];     
    System.out.println("Current day is : " + strDays[now.get(Calendar.DAY_OF_WEEK) - 1]  );
    Edited by: Ritushree Saha on Jun 4, 2009 1:09 PM

  • How to  find the Open sale orders till date for  given plant and material ?

    Hi experts,
                     I have a requirement to calculate the open sale orders for a given plant and material. I have tried in VA05 wherein i can get only for the material and sales area combination. From the document nos obtained from VA05 i can then find the plant. But my question is how do i get the output of VA05 into my progra. (can i use submit for a module pool report ).
    Also if ther is some other standard table or Function module to find the open sale orders till a given date ,it will be even more helpful....in which case i can drop the VA05 route.
    Kindly help
    Thanks in advance
    Ashwin

    Hi Ashwin,
        You can use SAP Tables VBAK and VBUP to get to know if the document is complete or not.
       VBUK-GBSTK is the field that will give you the status of the Sales Order .
      VBUK is used at header level , whereas VBUP is used for Item level.
      So in your case what I would do is :
      Get the Sales Orders that satisy the plant and material criteria from VBAP table , take this Sales Document numbers and go to VBUK or VBUP table to get the Sales Order Status. 
       If I need to find the open quantity as well I will link to VBFA table based on the document number.
      Reward if helpful.
    Thanks,
    Imran

  • How to find the source for an particular nuget

    Simple question.... with a GUI or Package Manager Console, how do I tell where a specific package came from?
    Thank Kevin

    Hi Kevin,
    >>Simple question.... with a GUI or Package Manager Console, how do I tell where a specific package came from?
    Since this forum is to discuss the VS IDE usage, for package manager console, maybe you could use the command line "get-help NuGet" to see all available NuGet commands.
    For example:
    Enter Get-Package -ListAvailable at the prompt to see a list of all packages  that are available in the selected package source.
    If we do not know the name of the package we want to remove, enter
    Get-Package at the prompt  without any flags to see a list of all of the packages that are currently installed.
    Reference:
    https://docs.nuget.org/consume/Package-Manager-Console-PowerShell-Reference
    https://docs.nuget.org/consume/package-manager-console
    A simliar thread:
    http://stackoverflow.com/questions/11867660/list-all-available-versions-of-a-specific-package-in-nuget-package-manager-conso
    Best Regards,
    Jack
    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.

  • Add the days to a particular date

    Hi all ,
    I got a date in my internal table .
    I got a integer which holds certain no. of days .
    I need to add that integer to the date .
    like i got 10.10.08
    integer is 5.
    i have to get 15.10.08
    pls let ,me know
    regards
    Raj

    Hi,
    Just add the integer to the date field..
    Ex..
    DATA: V_DATE TYPE SYDATUM.
    V_DATE = SY-DATUM + 5.
    Write: / 'Five days later the date will be, ', v_date.
    Thanks
    Naren

  • How to find the Sum based on Like Dates

    Hello everyone,
    Column 1 contains "Date Sent", Column 2 contains "Dates of Service" and Column 3 contains the payment "Amount" in USD. I want to write a formula that will total up the sum of payment values from column 3 based on the date of payment (Column 1).
    Thanks!
    Jared

    Hi Jared,
    This will do what's illustrated in your example, but has a few restrictions:
    The dates must run in ascending order.
    To get a total for the last date, a later date (with no corresponding amount) must be entered after the last transaction.
    Formula:
    Entered in D2, and filled down the rest of column D:
    =IFERROR(IF(A3>A2,SUMIF($A,A2,C),""),"")
    IFERROR is used to suppress the error message that arises from the formula in D10 referencing a cell in D11.
    Regards,
    Barry

  • How to find the work shift

    How to find the work shift of particular programe name.IF that pfgrame name is INXDSD.
    Any query ti fing out the work shift of this.
    please any body help me.

    Can you rephrase the question? Or provide some additional context?
    I assume this is somehow related to an Oracle database.
    - What is a "work shift"?
    - What is a "pfgrame"?
    - What "program name" are we talking about? Is this the name of a program that is connecting to an Oracle database? Or something else?
    Justin

  • How to find the technical name

    Hai,
    How to find the technical name of a data source for General Ledger: Balances – Period Breakdown
    Thanks

    Hai
    my question is in General Ledger: Balances – Period Breakdown
    the link is showing General Ledger : Balances , Leadingledger
    I got this link in queries for General Ledger: Balances – Period Breakdown
    http://help.sap.com/saphelp_nw70/helpdata/en/2d/955a73da4d6d41a0a6128caf274ce8/frameset.htm
    But here technical name of info cube is given.But i dont know how to find the technical name of the data source.This might be simple question i think but i am new to SAP
    Thanks

  • How to find the status of package (valid/invalid) was at a particular time

    How to find the status of package (valid/invalid) was at a particular time ?
    I want to find the status of one oracle package at 3pm yesterday. The status of this package today is INVALID.
    I am sure it was VALID yesterday. But no way to prove it. Can any one help please???
    I can generate AWR report for last 7 days...

    Try using a flashback query, like this:
    select object_name, object_type, status
    from dba_objects AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '18' HOUR)  -- 18 hours ago
    where object_name = 'MY_OBJECT'
    ;if you haven't granted FLASHBACK privs, you may need to connect as SYS to do a flashback query on a data dictionary table.
    But this should give you the info you need - if it's still in undo.

  • How to find the number of idocs generated for a customer on the basis of his purchase order in a day ?

    How to find the number of idocs generated for a customer on the basis of his purchase order in a day ?

    Dear Friends,
    I am absolutely agree with your answer .
    But my question is,
    Lets say.....
    One customer sending X number of purchase orders in a day , so how many IDocs generated on that specific day for that specific customer .
    So, Question is , How can we find the no of sales orders(IDocs) generated for the customers on the specific day ?
    Hope you all understood my requirement .
    Thanks & Regards,
    Aditya

Maybe you are looking for

  • How can I remove GRUB2 from my iMac?

    Hello Internet! I have a 21.5" iMac (intel based, version 10.7.5), and I have recently tried to install Ubuntu on it. Ubuntu installed successfully, and with it came GRUB2. Now, when Ubuntu started doing all sorts of wierd crap i decided i might as w

  • VISA Read over USB Problem: After a while the xBFFF0015 Timeout Error occurred

    Hi, I have trouble using labview with my non-NI USB device: The device is an analog input DAQ board. I was able to setup communication with the board using a VISA driver specifically created for this board and direct FW calls using the product's firm

  • Exporting images from the Captivate 5 Library

    I am able to export Captivate 4 images to a folder. I am able to export Captivate 5 images to a folder, but they cannot be opened with Fireworks or any other application I've tried. Although the file is a bmp, Fireworks says, "Could not open the file

  • Console program for iPhone terminated in 20 seconds on simulator

    Hi, I have a console program for iPhone which simply uses printf to output. It works fine on iphone but not on Simulator. I noticed that iphone has a watchdog time to stop a program which loading more than 20 seconds. I believe the simulator treats m

  • Help needed quick!!! How to download a management cockpit?

    Hello all, In three hours I have to give a presentation on a demo of a management cockpit I build. I would like to download the management cockpit and burn it on a cd so the participants can take it home. How to download a management cockpit? I know