Why can't i get the correct DAY_OF_WEEK given year, month and day

public String getPayrollRange(String whichhalf) throws SQLException{
int month_today = today.get(Calendar.MONTH) + 1;
int year_today = today.get(Calendar.YEAR);
int day_today = today.get(Calendar.DAY_OF_MONTH);
int end_day = 0;
int dayofweek = 0;
try{ connect();
str = "SELECT value FROM DEFAULTS WHERE variable LIKE '"+whichhalf+"%cutoff'";
rs = execSQL(str);
if(rs!=null)
{ if(rs.next())
end_day = rs.getInt("value");
rs.close();
dbCon.close();
//--------------- THIS IS THE MOST IMPT PART -----------------------
// i need to be able to set a Calendar object based on the integer variables
// my problem is when i retrieve the DAY_OF_WEEK for the given_date variable
Calendar given_date = new GregorianCalendar(year_today, month_today, 28);
str = given_date.toString();
}catch(Exception e) {
e.printStackTrace();
return str;
}

http://developer.java.sun.com/developer/qow/archive/152
index.jsphi! the link was a great help but 'now' refers to the current date.
my problem really is when a user specifies a given date and i'd like to get its DAY_OF_WEEK. i don't wanna use sql to get the DAYNAME.
pls help!

Similar Messages

  • FM to get the number of days in Year,month and days by giving number of day

    Hi ALL,
    This is quit differnt.
    I need to give input the 'start date' and the 'number of days' and get the total days from the start date in year,month and day format.
    for example.
    start date :01.01.2009
    number of days as 32
    then i should get
    years:0
    months :1
    days :1
    Pleas help me out.

    hi Anusha,
    first u pass the date and the days to the following fm you will get the result date....
    data:date type sy-datum,
          r_date(10) type c.
    date = sy-datum.
    CALL FUNCTION 'CALCULATE_DATE'
    EXPORTING
       DAYS              = '32'
       MONTHS            = '0'
       START_DATE        = date
    IMPORTING
       RESULT_DATE       = r_date
    write:/ r_date.
    then you need to pass the result date and the date to the following fm to get the required output...
    CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
        EXPORTING
          date1                   = r_date
          date2                   = date
        IMPORTING
          years                   = v_years
         months                 = v_months
        days                     = v_days
        EXCEPTIONS
          invalid_dates_specified = 1
          OTHERS                  = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    here u will get the difference in days,  months and year...
    i hope u wil get help from this...
    regards
    Ashu  Singh

  • Why can't I get the pdf to convert to publisher?

    Why can't I get the pdf to convert to publisher?

    If you are using ExportPDF, see http://forums.adobe.com/docs/DOC-1511

  • Why can't I get the Kodak Document Print App in the UK?

    Why can't I get the Kodak Document Print App in the UK?

    "Apparently it's available in the US iTunes store but not here?"
    Because Kodak has chosen not to make it available there.
    "Can't for the life of me understand why that should be!"
    You do not have to understand it for it to be so.
    You can try asking Kodak, as they make the app.

  • Why can't I get the App "Deskconnect" on my Ipad 3.  It claims to be compatible with Ipad as well as Mac and Iphone?

    Why can't I get the App "DeskConnect" on my Ipad 3.  It claims to be compatible with Ipad, Iphone and Mac.  I was able to download onto Mac and Iphone but it is not recognized for Ipad?

    I liked the idea of this app so I went looking for it and have now installed it on my Mac, iPhone and finally my iPad.
    This app, although it will run on the iPad is actually an iPhone/iPod app, as suggested above. So the only way to get it on my iPad was to search for it as an iPhone app in the App Store app on my iPad. Then it came up as an app that I could install on the iPad.

  • Why can I not get the creative cloud to install on my MacBook Air? I keep getting an error saying I need to download a new copy

    Why can I not get the creative cloud to install on my MacBook Air? I keep getting an error saying I need to download a new copy

    Please read https://forums.adobe.com/thread/1499014
    -try some steps such as changing browsers and turning off your firewall
    -also flush your browser cache so you are starting with a fresh browser
    http://myleniumerrors.com/installation-and-licensing-problems/creative-cloud-error-codes-w ip/
    http://helpx.adobe.com/creative-cloud/kb/failed-install-creative-cloud-desktop.html
    or
    A chat session where an agent may remotely look inside your computer may help
    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • Why can't I get the advanced selection available in EPUB export options in illustrator CC?  It's just not there.... Neither is the image selection available.  Only Epub reflowable and fixed layout, but not EPUB...

    Why can't I get the advanced selection available in epub export options in illustrator cc? It's not there and neither is image selection.  only epub reflowable and fixed layout but not just epub.. I don't know where it is to do some book exercises for my studies.  Very frustrating.

    This is the EPUB forum: InDesign EPUB

  • HT4667 why can't i get the download to install on my macbook pro for the air port express

    why can't i get the download to install on my macbook pro for the air port express ? 

    If you are running OS X 10.7.2 then you will be able to use AirPort Utility 5.6.
    Leopard, Snow Leopard: AirPort Utility 5.5.3.
    Tiger: AirPort Utility 5.3.2
    Panther: AirPort 4.2

  • HT1657 My download keeps freezing, and I have to buy it over and over again and it wastes money. I have now rented my movie 4 times and it still won't finish downloading. Why can't I get the rental for free if it keeps doing this?

    MY DOWNLOAD KEEPS FREEZING AND I HAVE TO KEEP BUYING IT OVER AND OVER AGAIN. IT'S WASTING MY MONEY. I HAVE NOW RENTED MY MOVIE 4 TIMES AND IT STILL WON'T FINISH DOWNLOADING. WHY CAN'T I GET THE RENTAL FOR FREE IF IT KEEPS DOING THIS? CAN YOU PLEASE HELP? THANK YOU.

    Please turn off your caps lock.  All caps indicates shouting, is considered rude and is difficult to read.  Many will not read such posts.
    If it doesn't finish downloading then just click Store>Check For Available Downloads
    There is no need to keep re-buying it.

  • Why can't I get the average function work with empty cells?

    Why can't I get the average function work with empty cells?

    The thing that I am having a problem with is that I made a different form that calculates the average no matter how may of the cells have numbers or not and I didn't use an if function.  I have tried with this other form and and it calulates as if all the cells where being used.  I am using the [*] in both instances but it only works in the one I did earlier.

  • Why can't I get the Mac to accept a dvd which it did yesterday evening?

    Why can't I get the Mac to accept a dvd to play which it did yesterday evening?

    Hi a brody,
    It's pretty well documented. Here's a Wikipedia article on the topic. Tons of other links to follow.
    The drives themselves weren't damaged (by trying to do something like write to the drive's firmware), but the rootkit was installed on any computer you put a loaded disk in.
    I had a couple of legally purchased CDs from that era, and they never played right. They would skip, stall and even spontaneously eject. And this was in various music CD players (home player, car), which the rootkit wasn't supposed to affect.

  • Why can I not get the normal firefox start page instead of the "yourall-in-one page I currently have

    why can I not get the normal firefox start page I had with my old computer (operating XP) instead of the "your all-in-one page" I have now I have moved onto windows 7

    I have looked as suggested under the Firefox tab but find the following listed as my homepage
    http://uk.foxstart.com/?rls=en:uk:zp
    Have I actually installed firefox program/start page or have installes something else?

  • Why can't anybody get the photos I send them from my Iphone 4s? I've sent it to blackberries, iPhone 3G, and other phones - nothing has been able to get them!

    Why can't anybody get the photos I send them from my Iphone 4s? I've sent it to blackberries, iPhone 3G, and other phones - nothing has been able to get them!

    Do you get a send error message or a red "!" when you send?  Do you have a data plan on your account?  Check that your carrier has you provisioned for MMS.

  • Why can't I get the slider on the right side to remain active ?

    Why can't I get the slider on the right side to remain "active" ?
    I'm using iTunes 11.4 on a Mac Pro with OS 10.9.5
    In good old iTunes 10.7  there was a slider on the right side that you can move up and down to locate songs.   That same slider is there, (but much smaller), with iTunes 11.4, but it seems to deactivate itself for reasons I do not understand.
    I have found that when I go to the lower right corner and resize the iTunes window the slider will appear briefly.   If I don't act very fast, that slider vanishes and I cannot scroll up and down.
    Thanks !!

    As Apple said in June, iOS 7 is not compatible with the 4G iPod.
    All the iOS devices compatible (iPhone 4 and later, iPad 2 and later, and 5G iPod touch) with iOS 7 have at least 512 MB of memory (RAM). The 4G iPod only has 256 MB

  • Why can't I get the free download to load for Acrobat x

    Why can't I get the free download for Adobe Acrobat X to install?   when you try to download it doesn't do a thing?

    Troubleshoot Adobe Download Assistant
    Mylenium

Maybe you are looking for

  • My ipod is connected to the computer but not shown in itunes

    so i hooked my ipod nano 4gb to my computer and it says do not disconnect on the screen. also the owner ipod is not showin in itunes player what should i do.

  • Problem with WRT330 n

    I have wireless router WRT330 N The router always rest and I don't know why !! plz help meeeeeeeeeeeeeeee

  • My application's page(sql report) run slowly

    Hi,All I have a apex with 3.2.1 version, on my WIN7 OS. The application can run normally, But sometimes the page sumbit very slowly,about need waiting 2 or 3 minutes (Most of time it runs normal) My reports is sql report, and not complicacy. These re

  • Replace leading Zero's

    Hi , one of my field var = 0000501 I want to display it like var =  ****501 I want to replace all leading  zero's with ' * ' . Replace statement replaces all zeros with  ' * ' & display var = ***51. I want my output = ****501. Plz help Thanks in Adva

  • Camera raw cs4 and sony dsc-rx100

    how do i make cs4 camera raw to work with sony's dsc-rx100?