Use of Calendar

I am learning about Calendars. My immediate aim is to print, as JLabels, the following for example:
Thu May 1
Fri May 2
Sat May 3
etc.
I have discovered that I need to create an instance of GregorianCalendar. I am able to set the required date, and change it in steps. Temporarily I am using println to see the results.
The API Library refers to the use of APRIL and SATURDAY etc as constant integers. I would like to know how to use these in two places.
The first is in the set method, where it won't compile if I use MAY instead of 4 as a parameter.
The second is in the get method; how do I get DAY_OF_WEEK to read Thu or THURSDAY?
I would appreciate any advice on how to implement these constant integers.
// (in class fields) 
  private Calendar calend = new GregorianCalendar();
// (In class constructor)
    // Set up calendar
        calend.set(2008,4,31);
        System.out.println(calend.get(Calendar.YEAR) + " Month:"
            + calend.get(Calendar.MONTH) + " Date:"
             + calend.get(Calendar.DAY_OF_MONTH) + " Day:"
             + calend.get(Calendar.DAY_OF_WEEK));
         calend.add(Calendar.DAY_OF_MONTH,1);
         System.out.println(calend.get(Calendar.YEAR) + " Month:"
             + calend.get(Calendar.MONTH) + " Date:"
             + calend.get(Calendar.DAY_OF_MONTH) + " Day:"
             + calend.get(Calendar.DAY_OF_WEEK));The output of this is
2008 Month:4 Date:31 Day:7
2008 Month:5 Date:1 Day:1
Edited by: uktrail on Apr 25, 2008 4:53 AM: error re DAY OF WEEK

Thank you, your first reply works well.
But your second reply leaves me somewhat bewildered.
First, the library says that Calendar is an abstract class. This is the first time I have come across abstract classes, so I look them up and find that you cannot instantiate an abstract class. Yet here you are quoting a Calendar method which DOES create an instance of Calendar! ??
I understood that a reason for using GregorianCalendar is that this has the methods of Calendar but it CAN be instantiated.
You then suggest creating a Date object with the required Year, Month, Date of month, and using that to initialise my Calendar. But I can only create a Date object using a microsecond-style time! As far as I can see, I can only get 2008-May-1 into one of these objects using GregorianCalendar.set or similar. (You do mention that possibility, but it seems to me to be the ONLY possibilty, in which case why not do it at creation?)
Given that I have no interest in the current time or locale, and I don't want to have to calculate the microsecond-time of 2008-May-1, why is your method preferable?

Similar Messages

  • For a few months now my ical keeps jumping back and forth.  It's very hard to use my calendar as it doesn't open on today, it may stay a few seconds and then it goes backwards to random dates and forwards.  It doesn't sit still so I can see what I have on

    My iCal is driving me nuts.
    It won't sit still when I am looking at my calender.  I try holding it still with one finger, two fingers and it just moves.  It jumps to random dates and I have no confidence in it any longer.   I use my calendar all the time and this just isn't good enough.
    I have gone into the apple store and they said they hadn't seen that before.  It did it while I was there.  They restored the phone and it didn't make any difference.
    I have turned the calendar off in settings - mail - icloud - deleted and then turned back on again.  It didn't help.
    I put the Google Calendar app on in the hopes I would have a calendar that wouldn't frustrate me and it is so slow in responding, I have deleted it.
    I see online that many others are having the same problem with their iCal. 
    It would be great to know the solution.
    Please help

    Hey everyone in Apple world!
    I figured out how to fix the flashing yellow screen problem that I've been having on my MBP!  Yessssss!!!
    I found this super handy website with the golden answer: http://support.apple.com/kb/HT1379
    I followed the instructions on this page and here's what I did:
    Resetting NVRAM / PRAM
    Shut down your Mac.
    Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.
    I went through the 6 steps above twice, just to make sure I got rid of whatever stuff was holding up my bootup process.  Since I did that, my MBP boots up just like normal.  No flashing yellow screen anymore!!   
    (Note that I arrived at this solution when I first saw this page: http://support.apple.com/kb/TS2570?viewlocale=en_US)
    Let me know if this works for you!
    Elaine

  • I got the iPhone 4S and I use google calendar and when the Sprint salesperson set up my phone only 2 months of my calendar went on my phone. How do I get my whole calendar to sync on my phone?

    I got the iPhone 4s and i use google calendar and when the Sprint sales person set up my phone, only 2 months showed up on my iPhone. How do I sync all of google calendar to my iPhone!

    Settings/Mail,Contacts,Calendar - there's a setting for how far back to sync calendars.

  • How can I use different calendars associated with different emails to see appointmen​ts separately​?

    I have 3 emails accounts on my Blackberry curve. I want to use different calendars for different type of reminders/appointments. How can I do that? In calendar I pressed menu key and then clicked on select calendar, choose one email address (email 1) then entered an alarm but now if I go to a different calendar associated with different email ( email 2), it also shows me that alarm which I entered in email 1 calendar. Thanks for help

    Don't have LV handy to open the old code, but I did read through the thread you referenced.  It sounds like the example configured 2 counters to create the variable-freq finite pulse train and configured a 3rd counter to count the # steps generated as verification.   That 3rd counter would be a problem for you as there is no internal timing signal connection between your 2 USB devices.  You would need to run a physical wire connection and change some of the config code to match.  Alternately, you could just delete all the code associated with the 3rd counter for now because it isn't strictly necessary.
    Further advice/questions:  Are you planning on a pure sine wave of frequency such that you oscillate with both positive and negative velocity (example: varying from -1000 to +1000 Hz clockwise)?  Or is there a nominal average frequency with a small sine wave superimposed (example: nominal of 1000 Hz clockwise, variation of +/- 50 Hz)?
    I *think* you may be dealing with more of a continuous pulsetrain situation, which is actually much simpler.  You would only need 1 counter/timer, though you would still perform the freq changes in a timed loop which uses the pulsetrain as its timing source.  You'd just need to keep track of your total elapsed time so you could figure out the right sinusoidal freq value at the moment you're ready to update it.
    Another subtlety to watch out for if you're oscillating about 0 velocity  -- don't try to create a frequency that is lower than the rate at which you need to update.  Also, with steppers you may have mechanical stability issues at low freqs like 10's to low 100's of Hz.    These kinds of things may need to be managed as special cases which force you to deviate from a "pure" sine wave.
    -Kevin P.

  • Fixed Assets Mid-Month rule using non-calendar fiscal months.

    Our fiscal year variant is year dependent with twelve posting periods.  For example, period 11 for fiscal year 2007 is defined as 29-Oct-07 through 25-Nov-07 and period 12 is defined as 26-Nov-07 through 31-Dec-07.
    Fixed Asset depreciation keys MSTL and NA1 use period control 03 (Pro rata at mid-period).  Period control 03 is currently not configured in our SAP development system.  The IMG help text for “Use of Half Months in the Company Code” states that “You cannot use half periods with non-calendar fiscal months”.  
    How do USA companies configure mid-month depreciation keys (like MSTL and NA1) and mid-quarter depreciation keys when they use non-calendar fiscal months?

    Mike,
    Would be helfpul if you can describe how you resolved the above issue
    Thanks.

  • Is anyone using the Calendar Server to send external invites?

    Is anyone using the Calendar Server to send external invites?
    We have a Mountain Lion server running DNS, Open Directory, File Sharing and VPN. We have recently stood up the Calendar server and it is working very well. Internal invites work fine and are instantaneous to computer, iPhone, iPad. We have the ports working so that calendar items created outside the network work fine as well. Only problem is we cannot invite anyone with an external e-mail address. Each time we do the Calendar Error Log populates with:
    2013-04-15 13:11:03-0500 [-] [mailgateway] 2013-04-15 13:11:03-0500 [Uninitialized] SMTP Client retrying server. Retry: 5 
    2013-04-15 13:11:03-0500 [-] [mailgateway] 2013-04-15 13:11:03-0500 [Uninitialized] SMTP Client retrying server. Retry: 4
    2013-04-15 13:11:03-0500 [-] [mailgateway] 2013-04-15 13:11:03-0500 [Uninitialized] SMTP Client retrying server. Retry: 3
    2013-04-15 13:11:03-0500 [-] [mailgateway] 2013-04-15 13:11:03-0500 [Uninitialized] SMTP Client retrying server. Retry: 2
    2013-04-15 13:11:03-0500 [-] [mailgateway] 2013-04-15 13:11:03-0500 [Uninitialized] SMTP Client retrying server. Retry: 1
    2013-04-15 13:11:03-0500 [-] [mailgateway] 2013-04-15 13:11:03-0500 [Uninitialized] [twistedcaldav.mail.MailHandler#error] Mail gateway failed to send message <[email protected]> from [email protected] to mailto:[email protected] (Reason: Failure with multiple causes.)
    We have set up an internal e-mail address. I have confined that it works fine. I have tried more than one internal account. I have also verified the settings through the command line by typing "sudo serveradmin settings calendar" The iMIP sending and receiving information is correct. There is no authentication type setting listed in the command line output even though there's a place to choose it in the Enable invitations by email - Edit button on the third screen. No matter what I choose it goes back to "login" and still doesn't work.
    The command line settings mention a port number 62310 as being the MailGatewayPort but opening that port on the network's firewall makes no difference. As I said external set up works fine from Mac/iPhone/iPad and push notification works fine as well.
    Is anyone using this functionality?

    I'm sorry. I forgot to add Mail to the list of services. I AM using mail on that server. Here's the iMIP portion of my settings output from Terminal.
    calendar:Scheduling:iMIP:Sending:Server = "boardwalkserver.kuhnwitt.com"
    calendar:Scheduling:iMIP:Sending:UseSSL = yes
    calendar:Scheduling:iMIP:Sending:Username = "calendarserver"
    calendar:Scheduling:iMIP:Sending:Address = "[email protected]"
    calendar:Scheduling:iMIP:Sending:Password = "password"
    calendar:Scheduling:iMIP:Sending:Port = 465
    calendar:Scheduling:iMIP:Enabled = yes
    calendar:Scheduling:iMIP:MailGatewayPort = 62310
    calendar:Scheduling:iMIP:Receiving:Server = "boardwalkserver.kuhnwitt.com"
    calendar:Scheduling:iMIP:Receiving:UseSSL = yes
    calendar:Scheduling:iMIP:Receiving:Username = "calendarserver"
    calendar:Scheduling:iMIP:Receiving:PollingSeconds = 30
    calendar:Scheduling:iMIP:Receiving:Type = "imap"
    calendar:Scheduling:iMIP:Receiving:Password = "password"
    calendar:Scheduling:iMIP:Receiving:Port = 993
    calendar:Scheduling:iMIP:AddressPatterns:_array_index:0 = "mailto:.*"
    calendar:Scheduling:iMIP:MailGatewayServer = "localhost"
    So Add mail to the services being used. Since Calendar is running on the mail server one would assume that it could communicate with it fairly easily.

  • I am trying to share calendars with my husband (using Google calendars). He can see my calendars, but I am having trouble seeing his. We both use iPhones.

    I am trying to share calendars with my husband (using Google calendars). He can see my calendars, but I am having trouble seeing his. We both use iPhones. We both have company email addresses. I have had to install and uninstall my gmail info on my iPhone multiple times due to errors sending and receiving emails from my company email address on my phone. For some reason, all of my emails are getting stuck in my outbox when my gmail account is installed on my phone. When I delete it, my emails get sent automatically. This is really annoying! I would do without the gmail account, but I need to share calendars with my husband. How do I fix this?

    If you have two-step verification turned on in your email account, you'll have to log in with a browser and turn it off.

  • We have 3 iPads 3 iPhones 3 Apple id's.  We want to use 1 calendar we can all access on each device and have each device update or sync and we all receive notifications from the one calendar. We do not want to share photos contacts, ect.  Please help

    We have 3 Apple Id's, each ID using an iPad and an iPhone (3 id's, 3 iPads, 3 iPhones). We want to use one calendar on all 6 devices and have that one calendar update or sync to all devices.  We would like all 6 devices to provide notifcations from the one unique calendar as well.  We do not want to share contacts, photos, ect.  Please suggest how to achieve this, with the name of the calendar, if I am to get one from the App store, and how to set this up.  Please talk in easy terms as I am technically Challenged. Thank you.  3 iPad air 2, 2 iPhone 6 plus, 1 iPhone 4s.

    Hello there MizzouTrojan,
    If I understand correctly you want all 6 devices to have access to a single calendar that each device gets notifications for and can edit. You can do that with an private iCloud shared calendar. First sign into www.icloud.com and use these steps from the following article to share a calendar:
    iCloud: Share a calendar with others
    Share a calendar privately
    Click the Share button to the right of the calendar name in the sidebar, then select Private Calendar.
    Note:    You can also share the same calendar publicly. For instructions, see the next task, “Share a calendar publicly.” 
    Type the invitee’s email address in the Add Person field and press Return.
    Click the pop-up menu with the invitee’s name and choose access privileges (View & Edit or View Only). 
    For each person you want to share the calendar with, repeat steps 2 and 3.
    When you’ve invited everyone and set their privileges, click OK.
    Invitation emails are sent from your iCloud email address to the participants you specified.
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • How to use Different Calendars in one DP Planning Area

    Hi Experts,
    I would like to know that whether it is possible to use different calendars in single planning area ? Will explain the scenario in details as under
    We have 3 plants having separate calendars (different weekly offs). Now using single planning area in DP, I have to plan the demand for all the 3 plants in weekly buckets.So I need to refer to 3 different calendars in single planning area. Is this possible in DP ? As far as I know, we can attach only one fiscal year variant to the planning area through storage bucket profile. Also in this case, the system do not refer to public holiday calendar there by assuming all day working except the weekly off.
    Thanks in advance
    Regards
    Sandeep

    Thanks Sujay for immediate reply. The time bucket profile will just help me see the data in different buckets say Daily, weekly or monthly. However this still doesn't solve my problem. As only 1 Fiscal Year Variant is attached to the storage bucket profile, the system still will read the same profile for all the plants & will assume the same weekly off for all the plants which is not true in reality.
    Any other suggestion for considering different weekly offs for different plants in the same planning area ?
    Thanks & Regards
    Sandeep

  • In order to use the calendar feature - Do I need to have another program

    I don't use anything to "Synch" my calendar with since I typically don't use anything "synch-wise"
    Do I have to use another app or can't I simply create a calendar on my Droid. Does this make sense?

    In other words - is the only way to enter appointments into my calendar on my phone by having to use Google calendar first & having to synchronize it? I use a paper calendar @ he office & do not use outlook or Google calendar to set appointments - there's no need for me to do that.
    Sooo I have to log on to my desktop, enter my appointment in my google calendar & then synchronize it to my droid??

  • How to use the calendar in beehiveonline?

    The docs suggest that you can use the calendar to schedule meetings.
    Assuming that I am using Outlook (connected to our internal beehive), and a customer is using Outlook connected to their email server.
    What steps are required to allow both of us to see each others availability and schedule a meeting?
    Thanks,
    Michael

    Hi Michael,
    You can use OBEO, Zimbra,Lightning or Caldav to connect to Beehive Online calendar, your customer too can use these clients. Calendar notification emails will come in your ST Beehive account, which will have an ics file as attachment. If required you can also add the external event to your ST Beehive calendar.
    Please refer to this link for client access information
    https://beehiveonline.oracle.com/External_02.html
    Thanks,
    Jereen

  • Using factory calendars in BI transformations

    Hello All,
    Do we have the option of using factory calendars in BI transformations, like we had in 3.x version update rules.
    I did not see any option for choosing the factory calendar, so i guess we will have to use function modules.
    Please let me know if there is any option available.
    Thanks in advance.
    Manoj

    hi Anton Moskvichev,
    I check in the source system assignment. The source system is checked. While replicating the DS from source system i replicated based on BI 7.0 only. While activating the cube or infoobject from BI content i did not get any transformation or transfer rules for activation. I just got the cube alone..

  • What is the best practice for using the Calendar control with the Dispatcher?

    It seems as if the Dispatcher is restricting access to the Query Builder (/bin/querybuilder.json) as a best practice regarding security.  However, the Calendar relies on this endpoint to build the events for the calendar.  On Author / Publish this works fine but once we place the Dispatcher in front, the Calendar no longer works.  We've noticed the same behavior on the Geometrixx site.
    What is the best practice for using the Calendar control with Dispatcher?
    Thanks in advance.
    Scott

    Not sure what exactly you are asking but Muse handles the different orientations nicely without having to do anything.
    Example: http://www.cariboowoodshop.com/wood-shop.html

  • How to use Javascript Calendar In ALUI portlet

    Hi all Sandip here ,
    I have just started to work on ALUI portal.I have one problem
    In my application I want use calendar bt problem is wherever I am using the calendar that page is loosing the focus once I am returning to that page using BACK link.
    If anyone has solution for this plz guide me.
    Thanks in Advance,
    Regards,
    Sandip.
    Sandip

    Hi,
    ADF Faces does not provide a method that allows you to call JavaScript on the client. This may change in upcoming versions
    Frank

  • I have 2 IPOD touches and now an IPAD2;I use outlook calendar and contacts, and now my devices are not syncing all the information in the calendar. Help?

    I now have 2 IPOD touches , 1 8 GB,1 32G plus an IPAD 2 that I've been having syncing issues with.
    my Dell D830 Latitude w/windows XP. I use outlook calendar and contacts, and the syncing is not
    completely syncing the outlook information. Help?

    Yes.  Just sync them to the same iTunes library.  iTunes will keep track of each so you can put what you want on each.  I do this with a 3G and iPad2. Note that each device will have it's own backup.

  • I am using my calendar and need others to be able to book appointsments on my behalf, how can I syncronise them to ensure one, up to date calander at all times?

    Hi all hope someone can help.  Just turned our small consultancy business into an Apple enterprise with 2 Imacs, an Ipad4 and IPhone 3g.  I want to run a consollidated calander where people can add appointments to my calander but if I am booking an appointment on the Ipad and my office manager is booking appointments I don't think we are sycronising properly as some of the appointments "get lost"  can anyone tell me where I am going wrong
    Wendy Garcarz

    Hi Wendy,
    If I was in your shoes, I would use Google Calendar. With Google Calendar you can easily set up shared calendars. Google calendars also integrate well with the Mac OS X calendar app and the iOS calendar app so whether you are using the iMac, iPad, or iPhone you'll see all of your appointments as well as ones scheduled for you (by whoever you shared it with) on the native devices calendar (we use shared Google calendars all the time between Macs and iOS devices and it works great).
    Have each of your employees sign up for a Google account. Once you sign in, click on the Calendar link at the top of the webpage. On the left side of the page under "My calendars" click on the drop down arrow. You should now see your name under My Calendars. Click on the drop down arrow next to your name and select Share This Calendar. Under "Share with specific people" you can enter the gmail address(es) of the employees who you want to grant access to. You have the ability to assign read only access if you just want other employees to see (but not schedule) your calendar, or assign read & write access for someone like your office manager so that he/she can schedule meetings for you.
    Google Account Sign-up
    https://accounts.google.com/SignUp?continue=http%3A%2F%2Fwww.google.com%2F&hl=en
    There is so much that Google apps can do. Along with the calendar, we love the Goole Drive to share documents and spreadsheets. I could go on and on about Google apps but will instead give you these links:
    Google Calendar: https://support.google.com/calendar/answer/2465776?hl=en
    Google Drive: http://www.google.com/drive/about.html?authuser=0
    Hope this helps!!!
    ~Joe

Maybe you are looking for

  • LookUpSet is Not working for multiple columns in SSRS 2008 R2

    Hi Friends, I have a problem when i use more than one LookUpSet in SSRS to display more than one value based on Day Number & other fields..Please find the below details and please suggest me a solution for this. Crystal :                  Day1      

  • Update HRMD_A infotypes from inbound Idoc

    Hi again all, I am trying to send inbound HRMD_A06 idocs to SAP to update infotypes for employees. The idocs are received by SAP, processed by the correct application and stored in the database for the employee. But the values already stored in the i

  • [SOLVED] Gnome-won't start

    Dear archies, I using fluxbox right now but I wanted migrate to Gnome 3.2.1 but I have problem with start. I used lxdm as login manager (becase there I can chooose session - but I tried gdm also with the same result). Login was OK but then I got just

  • Creative Universal Power Adapter: doesn't ship to Canada

    Creative doesn't ship the uni'versal power adapter to Canada (fulfillment by Amazon.com) ? http://us.store.creative.com/Uni'versal-Power-Adapter/M/B000GB4R66.htm Anyone in Canada know how to get this (apart from asking someone in USA to buy it and sh

  • How can I add a watermark to an iMovie?

    How can I add a watermark to an iMovie? I did it once before but can't remember how I did it.