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

Similar Messages

  • How to find the number of references created for a given  object ??

    How to find the number of references created for a given object in a big application environment.
    That means, if i give any object name (of my application) as input, then how can i find the[b] number of references created for that particular object ??

    Please do not post the same question multiple times.
    As for your original question, there is no direct way to do it.
    Especially not the way you phrased it,
    since objects don't have "names".
    Applications also don't have "names".
    They have classes and instances.
    Also, there are 2 related issues, and I'm not sure which one is the one you asked.
    #1. Finding the number of references to the same object.
    Eg.
    Map<String,String> a = new HashMap<String,String>();
    Map<String,String> b = new HashMap<String,String>();
    Map<String,String> c = a;In this case, there are only 2 objects.
    The first object has (at least) 2 references pointing to it.
    The second object has (at least) 1 reference pointing to it.
    (There may be more, if the HashMap library keeps
    references to these things, or if the HashMap object has
    some internal cyclic references...)
    If you're asking this, then it can't be done.
    It's an active research topic in universities
    and software research labs, called "alias analysis".
    Type it in google, and you'll see people are working hard
    and having little success so far.
    #2. Finding the number of instances created from a class.
    In this case, what you have to do is to add a counter to
    the constructor of the class. Every time an object is constructed,
    you increment the counter. Like this:
       class MyClass
           public static int counter = 0;
           public MyClass( )  { counter++; }
        // Then later in your program, you can do this:
        MyClass a = new MyClass();
        MyClass b = new MyClass();
        System.out.println(MyClass.counter); // It should show 2Note: you won't be able to do this to every class in the system.
    For every class you care about, you have to modify its constructor.
    Also: when an object is deleted, you won't always know it
    (and thus you won't always be able to decrement the counter).
    Finalizers cannot always work (read Joshua Bloch's
    "Effective Java" book if you don't believe me), but basically
    (1) finalizers will not always be called, and
    (2) finalizers can sometimes cause objects to not be deleted,
    and thus the JVM will run out of memory and crash

  • 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 Find the R/3 Table Name for a BW Data Source

    Hi there,
      Please advice how can I find the respective table name in R/3 for a particular BW DataSource ?
      P/S : I would like a technical how-to instead of referring the table names at HELP.SAP.COM
      For instance, for my Standard Business Content Info Cube 0CCA_C03(CO-OM-CCA: Statistical Key Figures) which extracts from BW Data Source: 0CO_OM_CCA_4
      My question is, how can I find out which specific tables in SAP R/3 is this Data Source pulling the data from ?

    Hi Dinesh,
       Data Source: 0CO_OM_CCA_4
       1) In my R/3, I ran SE16 : Table -> ROOSOURCE
       2) OLTPSOURCE -> 0CO_OM_CCA_4
       3) EXMETHOD = F1
         (Hence, I assume the Extraction Method is a Function Module)
       4) So, Function Module = BWOM_RS_GET_CTRSTA
       5) Run SE37 in R/3
          How do I find out the specific tables in this Function Module ?
          Would you please list them for me, so I can further refer to the individual tables ?

  • How to get the Change Document Header details for a given date

    Hi All,
    Can anyone help me on this Change Document Header details(CDHDR).
    Better way to pull the information of Change Document Header details(CDHDR). No Index is maintained for the tables.
    So please suggest better Optimising techniques to get the Change Document Header details(CDHDR).
    Using this Function module : CHANGEDOCUMENT_READ_HEADERS how to import the DATE_OF_CHANGE.
    Thanks in advance
    Regards
    Chakri

    HI,
    Go through the documenattion of the FM u can get the details.. and also where used list
    Regards,
    Nagaraj

  • Find the used space in datafile on any specific date

    Hi,
    We have a datafile created on 2-11-2009.
    I wish to find the used space in that datafile on 13-12-2009.
    From v$datafile and dba_data_files from the "BYTES" column it wld give me the current used space in the datafile.
    But how to find the used space in datafile on any specific date.
    Thanks.

    Hello,
    It depends on your Oracle release, starting with Oracle 10.1, you have the View dba_hist_tpspc_space_usage which may give you an history of the space used by the Tablespaces:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_3195.htm#I1023456
    You may have to pay for specific license to be allowed to access to this View which belongs to AWR (Automatic Workload Repository).
    Hope this help.
    Best regards,
    Jean-Valentin

  • 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

  • How to find the count of tables going for fts(full table scan in oracle 10g

    HI
    how to find the count of tables going for fts(full table scan) in oracle 10g
    regards

    Hi,
    Why do you want to 'find' those tables?
    Do you want to 'avoid FTS' on those tables?
    You provide little information here. (Perhaps you just migrated from 9i and having problems with certain queries now?)
    FTS is sometimes the fastest way to retrieve data, and sometimes an index scan is.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9422487749968
    There's no 'FTS view' available, if you want to know what happens on your DB you need, like Anand already said, to trace sessions that 'worry you'.

  • How to find the incremental growth of index for last few months

    Hi,
    How to find the incremental growth of index for last few months.
    Thanks,
    Sathis.

    Hi,
    Check the below link, it may help you!
    http://www.rampant-books.com/t_tracking_oracle_database_tables_growth.htm
    Thanks,
    Sankar

  • How to find the WebUrl alert was raised for external network

    I have two weburl's requestes to monitor under SCOM2007 R2
    url one:  https://www.asdftest.com
    url two:  https://www.lkjhtest.com
    "url one" is configured to access the weburl from internal network and external network(internet) as well.
    "url two" is not configured to access from external network(internet). only configured for for internal network.
    I have configured for scom monitoring for the above two urls using the SCOM 2007 R2 web application template. After configuration i have not received any alert from the "Url Two"
    Q1). I am expecting an alert for "Url two" because it is not configured for external network access. 
    why i was not received any alert for that.
    Q2). How to find an web Url alert is raised for internal network or external network. SCOM Tool is not asked me to specify that the weburl is is from internal/external network access.
    Q3). Particularly how to find the Url alert was raised for external network
    please suggest me and correct me if i am wrong. 
    Thanks in advance.

    Hi,
    Please refer to your another thread:
    http://social.technet.microsoft.com/Forums/en-US/10d32ff3-d1a5-4875-b1ad-bb01a5799a33/web-url-monitoring-internalexternal-network?forum=operationsmana
    Regards,
    Yan Li
    Regards, Yan Li

  • How to find the customer ledger account display for profit centerwise

    Dear All,
    how to find the customer ledger account display for profit centerwise
    Pleas give your valuable suggestion
    Regards
    Vishwajeet Sharma

    Hi
    check the tables
    A959
    A962
    A997
    The assignment depends on so many things
    with respect to which transaction you wants the PRCTR field for KUNNR?
    Regards
    Anji

  • How to find the TCODE that is created for the table maintanance generator

    Hi ,
    How to find the TCODE that is created for the table maintanance generator of particular table,if we only know the table name.
    Regards
    Ramakrishna L

    Hello,
    I try it this way
    1. Goto SE16 --> enter table TSTCP.
    2. In the selection-screen displayed, enter
    PARAM = *<ZTABNAME>*
    You will get the t-code for the TMG.
    BR,
    Suhas
    PS: Are you sure a t-code has been created for this TMG ?

  • How to find the cpu usage per query for a time period

    Hi All,
    Is there a way to find the cpu used per query for a given time period?
    DB:10.2.0.5
    OS:AIX
    Thanks

    user13364377 wrote:
    if there are multiple queries starting at the same time, then what to do?Handle:      user13364377
    Status Level:      Newbie (10)
    Registered:      Jul 5, 2010
    Total Posts:      264
    Total Questions:      113 (84 unresolved)
    why so many unanswered questions?
    clarify your question
    same SQL multiple times from different sessions?
    or
    different SQLs from different sessions?

  • How to identify the Stanadard Extractor  will support for Real time Data

    How to identify the Stanadard Extractor  will support for Real time Data  Acquisation . Enabled

    Hi
    In the ROOSOURCE table you can find the extract structures, go through all the fields of the extractor and if you find all of your equired fields exist ok else try to enhance for teh needed fields and go with user exit to populate the data for that fields'

  • 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));

Maybe you are looking for

  • How to create the new webservice in XI?

    Hi All, 1. Could you please tell me how to create the new webservice in XI? 2. What tools we have to use to create it.? 3. How to send the SOAP request to XI? Regards Sara

  • InCopy suddenly fails to open InDesign file

    I'm a designer working on my first book project using the InDesign/InCopy workflow, using Dropbox as our server. I share my .indd file (Mac) with one offsite editor who uses InCopy for the PC. We've been working without a glitch for about two months.

  • When entered to retrieve some details Skype name i...

    The other day I could not access my Skype account. So I click forgot password and tried to go from there. Now it's not recognizing the email I used for some reason and I tried all the emails I have just in case. I then tried forgot email address and

  • Web browser and script activeX controls and HTML data

    Hello, I'm trying to use the Microsoft Web Browser (IWebBrowser2) and Script (IScriptControl) activeX controls in Labview to evaluate and execute HTML script.  If I wire the web browser control's document object to the object input of the Script cont

  • LEOPARD UPDATE

    Does anyone know if I can jump from Panther to Leopard without installing Tiger ( osx 10.4) or not? I can't find Tiger anywhere and need to update my computer!