Date/Calendar Questions

How do I go about setting the following code to be called in a single command like like SetMyDate(5, 10, 30) instead of the long code which appears in the main()
currentTaskDate = new String(days[currentDate.getCalendar.DAY_OF_WEEK)]+ ", " + months[currentDate.get(Calendar.MONTH)] + " " + currentDate.get(Calendar.DATE) + ", " + currentDate.get(Calendar.YEAR));
CODE BELOW
// Created: 8/7/03
// Author: Dustin McBeth
// Estimated Time: 2 H
// Purpose: I'm trying to set a a globel date
// Steps
// - Make thingy and output date on system out commend
import java.util.*;                    // for table and stuff
import java.util.Date;               // for the calender
import java.util.Calendar;
public class MyDate {
     // Date Stuff
     static Date today = new Date();     
     static Calendar currentDate = new GregorianCalendar();
     // Setting text for date numbers
     public static String days[] = {"","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saterday"};
     public static String months[] = {"January","February","March","April","May", "June","July","August","September","October","November", "December"};
     static String currentTaskDate = new String(days[currentDate.get(Calendar.DAY_OF_WEEK)]
                                   + ", " + months[currentDate.get(Calendar.MONTH)]
                                   + " " + currentDate.get(Calendar.DATE)
                                   + ", " + currentDate.get(Calendar.YEAR));
     public static void main(String[] args) {
     currentDate.setTime(today);
     System.out.println(currentTaskDate);
     today = new Date(5, 10, 30);
     currentDate.setTime(today);
     currentTaskDate = new String(days[currentDate.get(Calendar.DAY_OF_WEEK)]
                                   + ", " + months[currentDate.get(Calendar.MONTH)]
                                   + " " + currentDate.get(Calendar.DATE)
                                   + ", " + currentDate.get(Calendar.YEAR));
     System.out.println(currentTaskDate);
}

Never Mind, I got it figured out:
// Created: 8/7/03
// Author: Dustin McBeth
// Estimated Time: 2 H
// Actual Time: 4 H
// Purpose: I'm trying to set a a globel date
// Steps
// X Make thingy and output date on system out commend (Done 8/7/03)
import java.util.*;                    // for table and stuff
import java.util.Date;               // for the calender
import java.util.Calendar;
public class MyDate2 {
     // Date Stuff
     static Date today = new Date();     
     static Calendar currentDate = new GregorianCalendar();
     // Setting text for date numbers
     public static String days[] = {"","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saterday"};
     public static String months[] = {"January","February","March","April","May", "June","July","August","September","October","November", "December"};
     static String currentTaskDate;
     static void setMyDate() {
//     today.set(Year, Month, Day);
     currentTaskDate = new String(days[currentDate.get(Calendar.DAY_OF_WEEK)]
                                   + ", " + months[currentDate.get(Calendar.MONTH)]
                                   + " " + currentDate.get(Calendar.DATE)
                                   + ", " + currentDate.get(Calendar.YEAR));
//     return this;
     public static void main(String[] args) {
     currentDate.setTime(today);
     setMyDate();
     System.out.println(currentTaskDate);
     today = new Date(5, 10, 29);
     currentDate.setTime(today);
     setMyDate();
     System.out.println(currentTaskDate);
}

Similar Messages

  • Calendar question(s)

    APEX 3.01, RDBMS 10GR2
    I am new to the APEX tool. Two calendar questions, please.
    (1) I have a requirement that the values in the calendar object ("year" drop box) need to go back to 1800. Currently, when selecting on the calendar object, the earliest year available is 1920. Any ideas on how to expand the range of "year" dates to allow the user to select as far back as 1800?
    (2) My requirement calls for limiting users to selecting the calendar object for populating the date field. Currently, while users have the calendar available to populate a date field, they are not forced to use it - ie. they could fill in the date field with a valid date and not use the calendar. Is there a way to limit user input of date fields to use the calendar object only?
    Thanks in advance,
    Barry D.

    Chrissy,
    Thanks for the suggestion on how to force the user to use the calendar instead of entering data directly into the date field box. While setting the HTLM Form Element Attribute to "disabled" works for entering a new date [user cannot input directly into field, must use calendar], however, when I save my record, the date field is not saved to the database. All other elements are saved to the database. The saving of all data elements including the date, was working prior to this change. When I removed the suggested element attribute from my field and save a new record, all data is saved.
    Any suggestions?
    Thanks in advance.
    Barry D.

  • I am using the big date calendar template and when I submit it to apple for printing I lose the name of two months. These names are not text boxes. I see the names when I send it in but something happens during the transmission to apple. It was suggested

    I am using the big date calendar template in iPhoto. I am on Lion 10.7.2, macbook air. The names of the months are on each calendar page but something happens when I send the data to Apple. The names are part of the template. They are not text boxes. I lose two names on the calendar after it is sent to Apple. Apple suggested I make a pdf file of my calendar before sending it in and check to make sure every name shows. I did this with a calendar I just sent in. The calendar was correct. All names of the months were showing. After sending the data two month names disappeard because when it arrived by mail, it was incorrect. Apple looked at my calendar via a pdf file and it was incorrect.  This is second time this has happened. I called Apple and they had me delete several folders in the Library folder, some preferences and do a complete reinstall of iPhoto.  I have not yet remade the defective calendar. I am wondering if anyone else has had this problem?
    kathy

    Control-click on the background of the view all pages window and select "Preview Calendar" from the contextual menu.
    You can also save the pdf as a file to compare to the printed calendar.  If the two names are visible in the pdf file then the printed copy should show them.  Contact Apple for a refund.  Apple Print Products - Apple Store (U.S.)

  • How to display Date Calendar in Oracle BI Answers Prompts (parameter)

    I'm still new to OBIEE.
    How to display Date Calendar in Oracle BI Answers Prompts (parameter)?
    Thanks.

    Hi,
    While creating Dash Board prompt choose the control to 'Calendar'.
    I think it is not possible to provide 'Calendar' control using Prompts tab while creating request.
    It is possible to write Java Script for a Column of data type 'char'. So, cast the date data type to char.
    Go to: Column Properties --> Data Format
    Choose override default data format to view the available options in the drop down list.
    I would be very happy if anybody acknowledge me that I am wrong.
    -Vency

  • F4 date/calendar help for an inputfield

    Hi All,
    I have a Input Field mapped to context attribute of type String. I want to use the date/calendar help in this field, is it possible?
    Just to clear, I was using a attribute of type Date and had a calendar help, but now this field was changed to type String and the users want to have a calendar help.
    Thanks,
    Luciano
    Message was edited by: Luciano Leite

    Hi Luciano,
    What kind of requirements do you have which forces you to use context attribute with type String?
    BTW, you can use following approach:
    1) create calculated attribute with type Date
    2) in setter method convert Date to String and store it into context attribute with type String
    3) in getter method parse String and convert it to Date
    I don`t really like it because you have to do 2 redundant operations - parsing and conversion.
    Best regards, Maksim Rashchynski.

  • Date & Calendar GUI solution

    My GUI must allow users to input date (month, day, year). Does anybody know if there is a utility in swing package which helps to anable this feature?
    I've tried to implement this using 3 JComboBoxes but that looks awkward & doesn't work properly.
    Please, does anybody knows anything about Date & Calendars for GUI

    Look there...
    http://www.toedtercom.de/en/jcalendar.html

  • The DATA CAP MEGA THREAD....post data cap questions or comments here.

    In the interest of keeping things orderly....This is the DATA CAP MEGA THREAD....post data cap questions or comments here.
    Please keep it civil.
    Comcast is testing usage plans (AKA "data caps") in certain markets.
    The markets that are currently testing usage plans are:
    Nashville, Tennessee market: 300 GB per month and additional gigabytes in increments/blocks ( e.g., $10.00 per 50 GB ). 
    Tucson, Arizona market: Economy Plus through Performance tiers receive 300 GB. Those customers subscribed to the Blast! Internet tier receive 350 GB; Extreme 50 customers receive 450 GB; Extreme 105 customers receive 600 GB. Additional gigabytes in increments/blocks of 50 GB for $10.00 each in the event the customer exceeds their included data amount. 
    Huntsville and Mobile, Alabama; Atlanta, Augusta and Savannah, Georgia; Central Kentucky; Maine; Jackson, Mississippi; Knoxville and Memphis, Tennessee and Charleston, South Carolina: 300 GB per month and additional gigabytes in increments/blocks ( e.g., $10.00 per 50 GB ) Economy Plus customers have the option of enrolling in the Flexible-Data plan.
    Fresno, California, Economy Plus customers also have the option of enrolling in the Flexible-Data plan.
    - If you live outside of these markets you ARE NOT currently subject to a data plan.
    - Comcast DOES NOT THROTTLE your speed if you exceed your usage limits.
    - You can check out the Data Usage Plan FAQ for more information.
     

    I just got a call today that I reached my 300GB limit for the month.  I called and got a pretty rude response from the security and data usage department.  The guy told me in so many words that if I do not like or agree with the policy that I should feel free to find another service provider.!!! I tried to explain that we watch Netflix and XFinity on-demand alot and I was told that that can not be anywhere close to the data usage. I checked my router and watching a "super HD, dolby 5.1" TV show on Netflix will average about 5-6 GB per hour (1.6MB/s) ... sp this means that I can only watch no more than 1-2 Super HD TV shows a day via Netflix before I run out of my data usage.    This seems a bit redicilous doesn't it? Maybe the TV ads about the higher speed than the competition should be accompanied with "as long as you don't use it too often"   Not a good experience ... 

  • Data archieving  questioner required

    Dear All,
    We have been approched by one of our cleint for DATA ARCHIVING from R/3 system.
    Management has pushed my name in this.
    Requirement is to prepare DATA ARCHIVING QUESTIONER template.
    Can please anybody help me out in this regard from MM point of view.
    Thanking you in advance.
    Regards
    Nasir Chapparband.

    Hi,
    Refer following link;
    [http://itmanagement.earthweb.com/datbus/article.php/3109221]
    SAP Data Archiving
    1.0 Introduction to Enterprise Data Archiving
    Currently, a large number of enterprises use SAP R/3 as a platform for integration of business processes. The continuous usage of SAP results in huge amounts of enterprise data, which is stored in SAP R/3. With passage of time, the new and updated data is entered into the system while the old data still resides in the SAP enterprise system.
    Since some of the old data is critical, it cannot be deleted. The difficulty is keeping the data you want, and deleting the data you do not want. Hence, a SAP database keeps on expanding rapidly and enterprise systems, which have limited data retention abilities for a few years, suffer from problems such as data overflow, longer transaction processing times, and performance degradation.
    The solution of this problem has led to the concept of Data Archiving in SAP. Data Archiving removes out-of-date data from the SAP database that the R/3 system does not need online, but can be retrieved on a later date, if required. This data is known as archived data and is stored at an offline location. Data Archiving not only consistently removes data from the database but also ensures data availability for future business requirements.
    One rule of thumb is that in a typical SAP enterprise system, the ratio of data required to be online and instantly accessible to old data, which could be archived, and stored offline is 1:6. For example, if an enterprise has 2100 GB of SAP database, the online data, which is frequently used by SAP users will be 300 MB and the rest (1800 MB) will be scarcely used and hence can be archived.
    1.1 Data Archiving u2013 Features
    It provides a protection layer to the SAP database and resolves underperformance problems caused by huge volumes of data. It is important that SAP users should keep only minimal data to efficiently work with database and servers. Data archiving ensures that the SAP database contains only relevant and up-to-date data that meet your requirements.
    Data archiving uses hardware components such as hard disks and memory. For efficient data archiving, minimum number of disks and disk space should be used.
    It also reduces the system maintenance costs associated with the SAP database. In the SAP database there are various procedures such as, data backup, data recovery, and data upgrade.
    SAP data archiving complies with statutory data retention rules that are common and well-proven techniques.
    SAP data archiving can be implemented in two ways. In the next section both options will be discussed in detail.
    Also refer following link;
    [SAP Data Archiving Tutorial|http://www.thespot4sap.com/articles/SAP_Data_Archiving_Overview.asp]

  • Adjusting Date Calendar

    I would like to set up a date calendar so that the user can select a year rather than scrolling through the months to get to the next year.
    The purpose of this is that the user can select a start date and a maturity date on different products ie. loans. We can then use the information (difference between dates) to determine payments, etc.
    Has anyone any information on this?

    When the calendar is displayed, click on the year and you'll get scroll "arrows" where you can quickly change the year.

  • Date/Calendar Rant

    **Rant Warning!**
    Java is my language of choice, but the whole Date/sql.Date/Calendar junk is horrid. I can't seem to get/keep any of that straight in my mind. To quote van der Linden's "Just Java" book, "It's a dumb approach: it makes the common case of simple date processing un-obvious. But at least Yak-herders in Syria can now use Java to calculate their birthday under the Babylonian calendar."
    **Rant Complete**
    Anyone know of an alternative date class somewhere that is simpler, more-straightforward, or designed to accomodate the common case? If not, maybe I'll write one, make it available to all java developers, and alleviate the suffering out there!
    Mike

    I wrote some code for handling dates as integers (the way many spreadsheets do it), it is in the JCommon class library (free subject to the terms of the GNU LGPL):
    http://www.object-refinery.com
    I know of a shareware (US$10) class called BigDate (better than the code I wrote, but not free) that you can find somewhere at:
    http://www.mindprod.com
    Hope that helps,
    Dave Gilbert
    JFreeChart Project Leader
    P.S. I still use Date and Calendar for a lot of things, because they are very powerful. It's just that sometimes I only want the date, not the time down to milliseconds as you get with the java.util.Date class.

  • Date&Calendar Tutorial

    There was a Tutorial on Date&Calendar, but I can't find it anymore ;)
    Can someone tell me where to find it?
    Or/and someone tell me the best way to handle "dates" ?
    (calculate age etc.)
    Greetings

    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html
    http://www.javaworld.com/javaworld/jw-03-2001/jw-0330-time.html
    http://www.java2s.com/Tutorial/Java/0040__Data-Type/0600__Gregorian-Calendar.htm
    http://www.siwaclub.com.cn/java.util/GetCurDate.html
    Message was edited by:
    java_2006

  • Does PSE6-Mac have Date/Calendar View?

    Hello
    Years ago, I used PSE for windows and I liked the date/calendar view, especially since, if I remember correctly, I could add text to a date even if I didn't have photos associated with that date.
    Does PSE6-Mac have this date/calendar feature?
    If not, do you know of a calendar application that does link with a set of photos, to link by date
    Thank you -
    Marion in Rochester

    No.
    PSE for the Mac has no Organizer features whatsoever.

  • Date Picker Calendar Question

    For the last several days I am looking for a way to incorporate into my php page (developed with Dreamweaver CS5) a date picker /Calendar (like the ones that the travel agencies have for example) that allows a user to enter in a input text field the date or if he/she chooses to click a button that will show a calendar (hopefully aligned with the text field)  - then the user should be able to click on  a selected date: action that triggers the dissapearance of the calendar and the selected date to be shown in the text field: This seems quite basic - but for some reason I cannot find a widget of anything that works this way.
    Any help is very much appreciated.
    Carla

    http://jqueryui.com/demos/datepicker/
    Gotta love jQuery!
    There is also an extension on the Adobe Dreamweaver Exchange [HERE]
    But I haven't had a chance to test this one and some of extensions are little out of date and have IE8 - so test to be sure.
    Hope this helps!
    Lawrence   *Adobe Community Professional*
    www.Cartweaver.com
    Complete Shopping   Cart Adobe Dreamweaver
    Stay updated - Friend, Follow, and Bookmark!
    http://www.twitter.com/Cartweaver
    http://www.cartweaver.com/facebook
    http://blog.cartweaver.com

  • E90 calendar questions

    Hi everyone.
    As a beginner at using the E90 calendar, I have some basic questions:
    #1 On a repeated event, if I want to change only one date of the events without moving the repeated ones, is it possible?
    #2 Is it possible to assign a repeat on a to-do entry?
    Thank You
    Jorge Teixeira

    no to both from/on the phone
    Wishing u a great time with your device,
    eseriesaddict
    Chennai
    India.

  • Group by day - evaluation date formula question

    Hello,
    I am currently working on a report for on-call coverage.  I am having difficulty grouping by date and I'm hoping someone can help me.  Here is my situation.
    The on-call database has a coverage start date and coverage end date.
    Person A has a coverage start date of 9/1/2009 and a coverage end date of 10/5/2009.
    Person B has a coverage start date of 9/15/2009 and a coverage end date of 10/10/2009.
    The report I am trying to create needs to be grouped by the calendar day of coverage.  What I mean is, I need to be able to evaluate the coverage for a particular day.
    If I run the report for the evaluation date of 9/10/2009, it would show Person A, their coverage start date and coverage end date.
    If I run the report for the evaluation date of 9/20/2009, it would show Person A and Person B, with their respective coverage start and end dates.
    My question is, how do I create this evaluation date?
    Since this is a report for on-call coverage, I will also need to run this evaluation date into the future to confirm that there aren't any gaps in coverage.
    What I need to do is run this report for so the evaluation date would be for the next month.  So if I ran the report today, it would show me the on call coverage for November 2009, grouped by day.
    Any help you can provide would be greatly appreciated.

    You will need a calendar-type table, with one record per date.  Then, base your report on something like (MS SQL):
    select calendar.date, on-call.name
    from calendar, on-call
    where calendar.date between '{?lowDate}' and '{?highDate}'
    and calendar.date between on-call.start_date and on-call.end_date
    The first condition of the Where clause selects all of the dates that you want to report.  The second selects each person on-call for each of the dates from the calendar.
    You could also code a loop in the SQL Command, but calendar tables are really quite handy.  (For example, to indicate what dates are company holidays, where no on needs to be on call...)  I'd suggest setting one up if you don't have one available.
    HTH,
    Carl

Maybe you are looking for

  • Printing BUT unable to print more than one copy

    When printing, I'm unable to print more than one copy

  • Not accepting max cell size more than 1000 in HFM form

    Hi in the task list in the user forms iam not able to insert more than 1000 characters in the dev server 11.1.2.1 while i can do that in the production server 11.1.1.3 please any one can solve this issue i think i need to increase the max cell size

  • Safari 5.0.3, open link in new tab problem

    I have a Mac 10.6.5. When I open safari it works fine, then if I right click on a link I see the options open in a new tab, or window (and many other options), when I click open link in a new tab it works, then in the new tab I have a problem: If I r

  • Skin is drawing on top of components

    I have a skin with HostComponent of SkinnableContainer. It looks like this: <s:BitmapImage source="@Embed(source='/img/skinGraphics/footer.png')" />     <s:Group id="contentGroup">     </s:Group> The skinnable container looks like this: <s:SkinnableC

  • Integrating "Chat Now" functions

    My client wants one of those "Chat Now" applications integrated into his website. Anyone have any experience with these? If so, I'd appreciate a referral to a reputable company that offers these live chat sessions and also any information about how t