About get(Calendar.DAY_OF_WEEK)

Hi,
I would like to ask if GregorianCalendar.get(Calendar.DAY_OF_WEEK) returns 0 for Sunday always, or it depends on the timezone and localization?
Thanks.

xpanta wrote:
thomas.behr wrote:
xpanta wrote:
By RTFM-ing people you are not helping them.Obviously, I beg to differ.
sorry to hear that, because it seems that your 2nd answer and tsith's answer gave me more information than the word "RTFM".
But that word is a link to the API where it says what values that field can take.
>
>
Much more important is the fact that the documentation does not mention any numeric values but constants >(which in turn implies that these values do not change). So, follow tsith's advice and code against the constants.thank you and tsith. This is something I didn't know, although I use it many times (just seems logical to do so)In general don't depend on anything that isn't documented in the API - the API documentation is a contract of sorts, but undocumented features might be changed or removed without warning.
Good Luck
Lee

Similar Messages

  • Modifying Calendar.DAY_OF_WEEK issue

    Hi,
    I'm trying to get a report to run so that it gets data for the previous "business day" (M-F). So if a user comes in on Monday, he would get a report for Friday. However, I'm running into an issue where I do the following (after I already get the Calendar object set to the Locale.US, and EST TimeZone):
    calendar.add(Calendar.DAY_OF_MONTH, -1);
    System.out.println(calendar.get(Calendar.DAY_OF_WEEK));
    // check for Saturday/Sunday
    if(calendar.get(Calendar.DAY_OF_WEEK) == 1)
      calendar.add(Calendar.DAY_OF_MONTH, -2); // FRIDAY
    if(calendar.get(Calendar.DAY_OF_WEEK) == 7)
      calendar.add(Calendar.DAY_OF_MONTH, -1); // FRIDAY
    System.out.println(calendar.get(Calendar.DAY_OF_WEEK));
    // WRONG DAY OF WEEK - I get a 3 not a 1 after the first .add() methodSo I'm not sure why it's acting strange, I still get the correct date (14) after the first .add but I'm kinda lost as to why the other comparisons do not work.
    Thanks in advance,
    Lior

    Reply, I'm not sure why this is happening again, but I'm running the program (my system date is working fine and I'm getting the right date when I print out the getTime() method) and getting the wrong day of the week:
    public class CalendarTest {
      public static void main(String[] args) {
         Calendar now = Calendar.getInstance();
         switch (Calendar.DAY_OF_WEEK) {
              case Calendar.MONDAY:
                   System.out.println("MONDAY"); break;           
              case Calendar.TUESDAY:
                   System.out.println("TUESDAY"); break;           
              case Calendar.WEDNESDAY:
                   System.out.println("WEDNESDAY"); break;           
              case Calendar.THURSDAY:
                   System.out.println("THURSDAY"); break;           
              case Calendar.FRIDAY:
                   System.out.println("FRIDAY"); break;           
              case Calendar.SATURDAY:
                   System.out.println("SATURDAY"); break;           
              case Calendar.SUNDAY:
                   System.out.println("SUNDAY"); break;
              default: break;      
      } // end main
    }I'm getting SATURDAY when running this test program. Why is this happening? I'm not sure at all.
    Thanks

  • Can't get Calendar to notify me about an appointment. Windows 7

    I enter a date and time in Calendar so I'll be notified of an appointment. Everything works fine - it accepts the time and message- but I am never notified of the appointment in mail. This has happened since I updated to Windows 7 with a new computer. Used to work great with my old machine.

    if your talking about google calendar, try this
    *https://addons.mozilla.org/en-us/firefox/addon/integrated-google-calendar/

  • I am unable to open Calendar on my iMac - this occurred after installing Security Update 2015-002.  I don't know if related.  A message pops up after several minutes saying Calendar quit unexpectedly (but it never really opens). How do get Calendar b

    I am unable to open Calendar on my iMac - this occurred after installing Security Update 2015-002.  I don't know if related.  A message pops up after several minutes saying Calendar quit unexpectedly (but it never really opens). How do get Calendar back?

    Hi Magsrobby,
    Welcome to the forum and thanks for posting. I'm really sorry to hear you've had so many problems. I can look into this for you if you wish. Drop me an email with the details. You'll find the "contact us" form in the about me section of my profile. Once I have the details we'll take it from there.
    Cheers
    David
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • Is it possible to get calendar appointment to have to be dismissed instead of going away once you unlock phone?

    I'm looking to see if it is possible to get calendar appointments to stay on the notification screen instead of disappearing once the phone is unlocked. Basically I want to have to dismiss all appointments on my phone. Is this possible?

    If you go into Settings>Notifications>Calendar, you can set that notification alert style to Alert, which I believe causes you to have to dismiss the alert before you can do anything else on the device. It will take me a couple of minutes to test this, since it will require me to make some changes to my device, but you might want to look at that. When you receive a notification for a calendar alert, I know you can swipe that alert and I see that individual calendar appointment displayed on the screen. I'm not aware of another method to display your daily calendar on the home screen when getting notifications.
    EDIT: I was correct. If you just unlock the phone, this dismisses the notification and will bring you to the home screen, no other information about the appointment. However, if you do not just unlock the phone and swipe the calendar notification on the screen it will bring you to that particular calendar notice. It will not, however show you other future appointments. That would require you to enter the calendar application.

  • How do I get calendar to forward birthdays to the next year?

    How do I get calendar to forward birthdays to the next year without having to type them all in again?

    Either set a repeating date on the event (repeat every 1 year) or set the birthday field in your contacts on iOS & OS X, then enable the birthday calendar in the  settings. I have no idea how to do this on Windows, so you will need to provide more info about what you are using if you are really on Windows.
    We'll get this moved somewhere more appropriate if you say what device & OS you are using.

  • Thinking about getting an xfi fat1l

    I was thining about getting an xfi fatility champion. but I was reading it seems to have alot of issues with vista x64 and 4 gigs of ram. So now I am a little worried.
    core 2 duo e6750
    intel p35 chipset gigabyte mobo
    4 gigs ddr2 pc 800 ram
    nvidia 8800 gts 52
    thermaltake 550 pure power, power supply
    Vista x64
    Anyone have any idea if it will give me some of the issues Ive read about here?
    Are there newer versions of the card with updated firmware that dont have those issues?

    noneoftheabove wrote:
    Many thanks for your responses krizanand.
     Are you sure?  it says NM is free for all. Besides, I was under the impression NM didn't require any specific Nokia APN to work (unlike BlackBerry), so http connections should just go through your provider's server. 
     Yes its indeed free till the expiration. In my country its free for lifetime but i have heard in this forum people not able to sync mails after using for sometime that may be because of operator restrictions. In that same page read point 2 carefully.
    I read that too, but luckily it applies to yahoo.com accounts only. I have a yahoo.de account so POP would work fine on an email client. 
    My question was more to do with folders and full sync/reconciliation. Do you have any experience with that?
     I never use Yahoo so can't vouch for it, inbuilt e-mail client on E72 supports accessing folders so it shouldn't be a problem once you set it up.
    Could you point me into the right direction? I googled it a lot, searched on this forum, but I haven't found anybody who successfully configured contacts and calendar.
    I would have done the same thing(i.e. googling). A work around is to use this.
    Got that, but can I set it up to run and log in at phone boot?
    Logging in at the start up depends upon the application, if it the app has an option, I hope it has, you can do it.
    If a reply has solved your problem click Accept as solution button, doing it will help others know the solution. Thanks.

  • I have a question about the calendar on the ipad2. I have multiple calendars in different colors. Some of the events are filled in with color. Others are just listed with a colored dot in front of the event. Any ideas why events ar showing up differently?

    I have an ipad2 and my question is about the calendar. I set up multiple calendars with different colors. Some of the events show up in filled color. Others only show with a colored dot in front of the event. I can't figure out why some show up one way and others show up differently? Any thoughts?

    On mine the ones that show on a coloured background are all-day events, the ones with dots and just timed events.

  • I have an iphone 4 and thinking about getting an ipad2.  Can i use the same apple id for both devices?

    I have an iphone 4 and I am thinking about getting an ipad2.  Can I use the same apple id and itunes account with both of them?  Will my contacts and apps transfer over to the iPad2?

    Yes. I use the same Apple ID on four different iDevices. You can sync the contacts with iCloud or with your computer and have them on both devices. You can sync all of the apps as well. If the apps are not in iTunes on your computer - you can download them to the iPad with the same Apple ID. You can also restore the iPad from a backup of the phone to transfer your settings, app data and your contacts.
    iPhone only apps will be half size on the iPad screen but will still work as long - you can enlarge the size of the apps - but they will be pixelated on the screen.

  • How do I get Calendar to suggest name and address from Contacts on my iPhone 5 in iOS 8?

    How do I get Calendar to suggest name and address from Contacts on my iPhone 5 in iOS 8?

    Restore it from your backup.

  • How do I go about getting the product serial number to register my product as well as install my product.  I bought it with a product box.  On the software disc sleeve, there is a series of numbers pasted at the bottom of the sleeves but this is not valid

    How do I go about getting the product serial number to register my product as well as install my product.  I bought it with a product box.  On the software disc sleeve, there is a series of numbers pasted at the bottom of the sleeves but this is not valid.  When I tried to type this in for registration, it does register as this numbers also contain letters in it.  Apparently the registration boxes accept numbers only.  What do I do with a useless product for which I have paid good money for it?????

    This is the simple solution which was offered to me when I tried to get the serial code on line.
    The box and disc sleeve do not contain a series with 24 numbers which I presume is the product code to install.
    I tried to redeem the registration code by following what they recommended, but inevitably it gets to the page that showed the registration boxes that need 24 serial numbers and I got stuck again.
    This product is so different what my previous experiences of other software products where I just enter the serial number straight from the disc sleeve and then I got registered and go on to use the software.
    I is really frustrating, spending the last two hours trying to get my product going....

  • TS1292 I have recently received an iTunes card and after scraping away the panel to get my code the first part of the code is unreadable how do I go about getting a code for the card

    Hi there I have recently been given an iTunes card as a present.i went to use it today to put credit on my account and after scraping away the panel found that I couldn't read part of the code that was on the card how do I go about getting the card activated?

    If the page that you postted from doesn't help then you will need to try contacting iTunes support (you will need to give them as much of the serial number and activation code from the card as you can read) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then iTunes Cards And Codes

  • How to get calendar travel time (set up in Mavericks) to show on iOS 7 calendar?

    I was wondering how to get calendar travel time (set up in Mavericks) to show on iOS 7 calendar? If I change a location in mavericaks it is updated in my iOS 7 calendar, but if I add travel time to an appointment, that does not show up on my iphone. This seems like a big miss for apple if this is the case. I could maybe understand not adding the ability to add travel time in iOS 7, but not being able to see the travel times you set up seems very incomplete. Any ideas or insight?

    Hello Cheer,
    I don't believe the table changed when migrating from Access.  I had two tables before the migration, one was for the SwitchBoard Manager and the other table was for the database table.  I used the Switchboard to navigate to different menus, such
    as the Main Form, Power Form, Server Form, etc.  Let me know if I can provide any other information to help you narrow this down for me.   
    Thank you for your assistance. 
    Thai

  • How to get "Calendar in the View" displayed on the page where Calendar web part is displayed?

    I have a calendar with overlay set up for 5 views. When the calendar list is open in full page, the "Calendars in View" is displayed on the left pane with all 5 views listed by colors.
    1) I want to display the calendar right on the home page, so I added the calendar web part to the page. But the problem is the "Calendars in the View" does  not show up on the quick launch on home page, it only shows up in calendar list view.
    How can I get "Calendars in View" displayed on left pane when calendar web part is displayed? so that users can select different views?
    2) Also it will be better if the "Calendars in View" can display all components of the overlay when not in the default view, so user can toggle thru different views to see each one on the main pane.
    Currently, only the default view has all colored views displayed under "Calendars in Views", once you click another view on the list, it just displays the current view, and you have to click the "Calendar" to see all and select another
    one.
    Really appreciated if someone can give a solution for at least the #1 problem. great if you have a solution for #2 as well!

    Hi,
    According to your post, my understanding is that you wanted to know how to add iFrame via Content Editor web part.
    There are two articles for your reference.
    How to insert an iFrame into a SharePoint web page
    Embed YouTube video in SharePoint 2010
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • I rented a movie on iTunes and, really annoyingly, it has stopped 30 minutes before the end. Any suggestions? And how do I go about getting a refund?

    I rented a movie on iTunes and, really annoyingly, it has stopped 30 minutes before the end. Any suggestions? And how do I go about getting a refund? Thanks so much for any suggestions.

    Hi alefiya,
    Welcome to the Support Communities!  It sounds like the movie didn't completely download. This link will get you in contact with the iTunes Support Team.  They will be able to review your account with you:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
    http://support.apple.com/kb/HT1933?viewlocale=en_US
    Cheers,
    - Judy

Maybe you are looking for

  • Issue while mapping two entity column into one entity column

    Not able to succeed with when trying to join 2 entity columns to an entity. Entity A Id, AName, ADesc, AQty Entity B Id, AName, BQty Entity C Id, AName, CQty Mapping Entity A to Entity B & Entity C with column reference, not able to succeed with two

  • Hiding Comment / Share Buttons in Reader X

    Is there a way to hide or disable the "Comment" and "Share" buttons that are shown in the toolbar in the top right corner of Adobe Reader X? I am embedding an XFA PDF Form in a web browser for my web application and I do not wish to have these button

  • Adobe Reader XI Update failed.  How to fix?

    When my windows 7 64 bit computer was updated to adobe reader XI, the update function began to continually fail.  I am getting the following "Adobe Reader Updater" message: "Update Failed  An error occured.  Please check for updates again later.  Err

  • How to fix a message WIB INIT FAILED

    HOW I FIX THE MESSAGE WIB INIT FAILED

  • Link to download oracle Database 9.2.0.1

    Hi, I was surprised that I didn't see the link to download the Oracle Database 9.2.0.1 on Oracle Downloads web site that used to be there. Where shall I find a link to download the base release? Kindly advice, Regards, C.