Java Calendar Getting day

I am developing a app..in which i have to find how many days are in a month and day of that particular day.
What i have done so far is following:
int year = 2003;  //actually ill be getting these data from input field. this one is just test
int month = 10;
String [] months = {"january","february","March"}; //and so on until december
int [] monthDays ={31,28,31,30...};
String [] dayOfWeek ={"Monday","Tuesday","Wednesday"}; //list is upto sunday
GregorianCalendar calendar = new GregorianCalendar(year,month,1);
int daysInMonth = monthDays[month];
int dayOfTheWeek = calendar.DAY_OF_WEEK;
String day = dayOfWeek[dayOfTheWeek];
// im stuck from hereFrom the code above i am expecting to get the day of the first day that is 1.
So from here how do i go and assign the day to other days like 2,3,4.
I cant use the table form, so that means a placing sun, mon, etc on the
top and then placing 1,2,3 is not. I wanna place day next to the number(1,2,3)
how can i do that?
any help will be appreciated?
thanx in advance

The Calendar class and its associated GregorianCalendar class are extremely badly written. They waver between being pure procedural code to wrongly conceived object structure. Witness, for example, a change in one of the parameters, such as the Month, of the Calendar, and how the authors have the audacity to state: the change in such a VITAL parameter will not be reflected in the rest of the object to.... save processor time! As a result the object is simply inconsistent and as such unreliable, fullstop!
But the errors are so many and everywhere. The following code, run on December 24, 2005:
GregorianCalendar c = new GregorianCalendar()
System.out.println("Day number: " + c.get(GregorianCalendar.DAY_OF_YEAR);
It will produce:
DayNumber: 358
Unbelievable, one might say.
Such code should not be allowed to be published and SUN bears the responsibility of adopting it blindly without verifying that it is badly written and drenching with errors and misconceptions that date back to the heyday of UNIX mentality, when objects are simply wrappers of legacy procedural code, and in this case with bugs galore, to add insult to injury!
If anybody knows of a decent less ostentatious (and buggy) calendering code, please come to the rescue.
Khaled El-Bizri
[email protected]

Similar Messages

  • Get "day" knowledge java.sql.Timestamp

    hello,
    i have looked at api but can not find out how to get day knowledge of a timestamp.
    i thinked to use java.util.date but its getDay method is deprecated.
    i need to get day of a date value that i get from database, or current time. what should i do?
    thanks.

    espilce wrote:
    i thinked to use java.util.date but its getDay method is deprecated.
    i need to get day of a date value that i get from database, or current time. what should i do?It also says what to do instead [Date.getDay()|http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#getDay%28%29]
    [Calendar.setTime()|http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html#setTime%28java.util.Date%29]

  • TS1702 help, are you having the same problem? iPad 2 calendar, can't get the month of March, can get days in March, but not month view. Any suggestions, thank u.

    help, are you having the same problem? iPad 2 calendar, can't get the month of March, can get days in March, but not month view. Any suggestions, thank u.

    Hi melbernai - not sure if you've solved this problem yet. I had the exact same problem recently with my 2nd Gen iPod Nano. I solved it yesterday by simply updating iTunes to the most recent version, after which I could get rid of the register screen. The only other thing I needed to do to add my custom playlists was select "Manually manage music" on the screen for my iPod, since it had been in an automatic synching mode since the problem occurred.

  • Java Calendar Help Needed :)

    Hi,
    I am trying to develop a Java Event Calendar which is able to display the calendar weekly. So the JPanel will be setup with 7 JLists for the days of the week. Buttons will allow switching of the days of the week, months and year.
    Each JList corresponding to the day of the week will have its data obtained from the database using JDBC and loaded upon 're-drawing' of the lists.
    However i am having trouble with the GUI side in understanding how to implement this, i am confident with the JList and database side of things, i have just used a similar example using the Calendar API for monthly displays, however i am unsure how to convert this to a weekly calendar.
    Ideally 7 JLists will always be available in the panel in order M,T,W,T,F,S,S but some will be set to inactive (for example in the first and last weeks of the month).
    If anyone has any suggestions please could you help me out :)
    Sorry if what im trying to do is a bit confusing.
    I've included the code i've been using for the monthly calendar
    THANKS!!
    public class CalendarPanel extends JPanel implements ActionListener {
      private Calendar panelDate;
      private Label monthLabel;
      private Label yearLabel;
      private Panel daysPanel;
      private Vector calendarListeners;
      private static final String days[] = {"S","M","T","W","T","F","S"};
      public CalendarPanel(){
        super(new BorderLayout());
        panelDate = Calendar.getInstance();
        buildUI();
      public CalendarPanel(Calendar date){
        super(new BorderLayout());
        panelDate = (date != null) ? (Calendar)date.clone() : Calendar.getInstance();
        buildUI();
      public CalendarPanel(Date date){
        super(new BorderLayout());
        panelDate = Calendar.getInstance();
        if(date != null) panelDate.setTime(date);
        buildUI();
      public Calendar getCalendar(){ return panelDate;}
      public void setCalendar(Calendar date){
        if(date != null){
          panelDate = (Calendar)date.clone();
          redrawPanel();
      public void setCalendar(Date date){
        if(date != null){
          panelDate.setTime(date);
          redrawPanel();
      public int getYear(){ return panelDate.get(Calendar.YEAR);}
      public String getMonthName(){
        switch(panelDate.get(Calendar.MONTH)){
        case Calendar.JANUARY: return "January";
        case Calendar.FEBRUARY: return "February";
        case Calendar.MARCH: return "March";
        case Calendar.APRIL: return "April";
        case Calendar.MAY: return "May";
        case Calendar.JUNE: return "June";
        case Calendar.JULY: return "July";
        case Calendar.AUGUST: return "August";
        case Calendar.SEPTEMBER: return "September";
        case Calendar.OCTOBER: return "October";
        case Calendar.NOVEMBER: return "November";
        case Calendar.DECEMBER: return "December";
        case Calendar.UNDECIMBER: return "Undecimber";
        default: return "Unknown";
      private void buildUI(){
        this.add(buildHeaderPanel(), BorderLayout.NORTH);
        daysPanel = new Panel(new GridBagLayout());
        redrawPanel();
        this.add(daysPanel, BorderLayout.CENTER);
      // build the part of the gui that contains the month and year
      // labels with their incrementors / decrementors
      private Panel buildHeaderPanel(){
        monthLabel = new Label(getMonthName(), Label.CENTER);
        yearLabel = new Label(Integer.toString(panelDate.get(Calendar.YEAR)),
                     Label.CENTER);
        GridBagConstraints gbc = new GridBagConstraints();
        Panel headerPanel = new Panel(new GridBagLayout());
        // month label and buttons
        Panel panel = new Panel(new GridBagLayout());
        Button button = new Button("-");
        button.setActionCommand("decrease month");
        button.addActionListener(this);
        gbc.anchor = GridBagConstraints.EAST;
        panel.add(button, gbc);
        gbc.anchor = GridBagConstraints.CENTER;
        panel.add(monthLabel, gbc);
        button = new Button("+");
        button.setActionCommand("increase month");
        button.addActionListener(this);
        gbc.anchor = GridBagConstraints.WEST;
        panel.add(button, gbc);
        gbc.anchor = GridBagConstraints.CENTER;
        gbc.weightx = 1;
        headerPanel.add(panel, gbc);
        // year label and buttons
        panel = new Panel(new GridBagLayout());
        button = new Button("-");
        button.setActionCommand("decrease year");
        button.addActionListener(this);
        gbc.anchor = GridBagConstraints.EAST;
        gbc.weightx = 0;
        panel.add(button, gbc);
        gbc.anchor = GridBagConstraints.CENTER;
        panel.add(yearLabel, gbc);
        button = new Button("+");
        button.setActionCommand("increase year");
        button.addActionListener(this);
        gbc.anchor = GridBagConstraints.WEST;
        panel.add(button, gbc);
        gbc.anchor = GridBagConstraints.CENTER;
        gbc.weightx = 1;
        headerPanel.add(panel, gbc);
        return headerPanel;
      // redraws the entire panel, including relaying out of
      // the days buttons
      private void redrawPanel(){
        monthLabel.setText(getMonthName());
        yearLabel.setText(Integer.toString(getYear()));
        // redraw days panel
        GridBagConstraints gbc = new GridBagConstraints();
        // clear current days panel
        daysPanel.removeAll();
        gbc.fill = GridBagConstraints.BOTH;
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.weightx = 1;
        gbc.weighty = 1;
        // add days of week
        for(int i = 0; i < days.length; i++, gbc.gridx++)
          daysPanel.add(new Label(days, Label.CENTER), gbc);
    gbc.gridx = 0;
    gbc.gridy++;
    // days of month
    Button button; // day buttons
    JTable day = new JTable();
    Calendar today = Calendar.getInstance();
    Calendar cellDay = (Calendar)today.clone();
    int month = panelDate.get(Calendar.MONTH);
    int year = panelDate.get(Calendar.YEAR);
    // start with first of panels month
    cellDay.set(year, month, 1);
    gbc.gridx = cellDay.get(Calendar.DAY_OF_WEEK) - 1;
    while( cellDay.get(Calendar.MONTH) == month ){
    if(gbc.gridx > 6){
         gbc.gridy++;
         gbc.gridx = 0;
    button = new Button(Integer.toString(cellDay.get(Calendar.DATE)));
    button.addActionListener(this);
    if( cellDay.equals(today)){
         button.setForeground(Color.red);
    daysPanel.add(button, gbc);
    gbc.gridx++;
    cellDay.add(Calendar.DAY_OF_MONTH, 1);
    // re validate entire panel
    validate();
    // implementation of ActionListener interface
    // currently no real need to create subclassed action
    // events for calendar. All actions generated by this
    // are action events (generated from the buttons).
    // the action command will be one of the four below
    // or a number (the label of the day button!).
    public void actionPerformed(ActionEvent ae){
    String command = ae.getActionCommand();
    if(command.equals("increase month")){
    panelDate.add(Calendar.MONTH, 1);
    redrawPanel();
    } else if(command.equals("decrease month")){
    panelDate.add(Calendar.MONTH, -1);
    redrawPanel();
    } else if(command.equals("increase year")){
    panelDate.add(Calendar.YEAR, 1);
    redrawPanel();
    } else if(command.equals("decrease year")){
    panelDate.add(Calendar.YEAR, -1);
    redrawPanel();
    notifyCalendarListeners(ae);
    // methods for keeping track of interested listeners
    public void addCalendarActionListener(ActionListener al){
    if(al != null){
    if(calendarListeners == null) calendarListeners = new Vector();
    calendarListeners.addElement(al);
    public void removeCalendarActionListener(ActionListener al){
    if((calendarListeners != null) && (al != null)){
    calendarListeners.removeElement(al);
    private void notifyCalendarListeners(ActionEvent ae){
    if((calendarListeners != null) && (!calendarListeners.isEmpty())){
    java.util.Enumeration e = calendarListeners.elements();
    while(e.hasMoreElements())
         ((ActionListener)e.nextElement()).actionPerformed(ae);

    Hi,
    Sorry for the change of screen name, i'm having trouble with my old account.
    I have now got most of the system working. However I am having trouble working out how to stop the last days of the previous month appearing in the first week of the next month. For example on 'July 2008' , days 29 and 30 of June are present in the first week of July. How can i get rid of this? And also for the last week of the month, how to get rid of the first days of the next month?
    import java.awt.BorderLayout;
    import java.awt.Button;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.GridLayout;
    import java.awt.Label;
    import java.awt.Panel;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.Vector;
    import javax.swing.BorderFactory;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.JPanel;
    import javax.swing.JPopupMenu;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.border.Border;
    import javax.swing.border.EmptyBorder;
    import javax.swing.border.EtchedBorder;
    * @category CalendarSystem
    * @author Daniel Barrett
    public class CalendarSystem extends JPanel implements ActionListener, MouseListener, KeyListener   {
         JPanel events = new JPanel();
         JPanel action = new JPanel();
              //Events Panel
         DateComboBox eventDateChooser = new DateComboBox();
         JTextField ref = new JTextField(10);
         JTextArea eventDetails = new JTextArea();
         JScrollPane scrollingArea = new JScrollPane(eventDetails);
         JTextField dateF = new JTextField(15);
         JTextField timeF = new JTextField(15);
         String[] minutes = {"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"};
         String[] hours = {"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"};
         JComboBox minsComb = new JComboBox(minutes);
         JComboBox hourComb = new JComboBox(hours);
              //Actions Panel
         JButton delete = new JButton("Delete");
         JButton purge = new JButton("Purge");
         JButton add = new JButton("Add");
         JButton edit = new JButton("Edit");
         JButton mview = new JButton("Month View");
         protected JLabel monthLabel;
         protected JLabel weekLabel;
         protected JLabel lmonday = new JLabel("");
         protected JLabel ltuesday = new JLabel("");
         protected JLabel lwednesday = new JLabel("");
         protected JLabel lthursday = new JLabel("");
         protected JLabel lfriday = new JLabel("");
         protected JLabel lsaturday = new JLabel("");
         protected JLabel lsunday = new JLabel("");
         protected Calendar calendar;
         protected SimpleDateFormat monthFormat = new SimpleDateFormat("MMM yyyy");
         protected SimpleDateFormat dayFormat = new SimpleDateFormat("MMM");
         JPanel monthCont = new JPanel();
         JPanel weekCont = new JPanel();
         JPanel yearCont = new JPanel();
         JPanel daysOfWeek = new JPanel();
         JPanel monday = new JPanel();
         JPanel tuesday = new JPanel();
         JPanel wednesday = new JPanel();
         JPanel thursday = new JPanel();
         JPanel friday = new JPanel();
         JPanel saturday = new JPanel();
         JPanel sunday = new JPanel();
         JList mondayEvents = new JList();
         JScrollPane mondayEventsScroll = new JScrollPane(mondayEvents);
         JList tuesdayEvents = new JList();
         JScrollPane tuesdayEventsScroll = new JScrollPane(tuesdayEvents);
         JList wednesdayEvents = new JList();
         JScrollPane wednesdayEventsScroll = new JScrollPane(wednesdayEvents);
         JList thursdayEvents = new JList();
         JScrollPane thursdayEventsScroll = new JScrollPane(thursdayEvents);
         JList fridayEvents = new JList();
         JScrollPane fridayEventsScroll = new JScrollPane(fridayEvents);
         JList saturdayEvents = new JList();
         JScrollPane saturdayEventsScroll = new JScrollPane(saturdayEvents);
         JList sundayEvents = new JList();
         JScrollPane sundayEventsScroll = new JScrollPane(sundayEvents);
         protected Color selectedBackground;
         protected Color selectedForeground;
         protected Color background;
         protected Color foreground;
         public CalendarSystem(){
              setupDays();
              setupHeaders();
              setupEvents();
              setupActions();
              this.calendar = Calendar.getInstance();
              this.calendar.setFirstDayOfWeek(Calendar.SUNDAY);
              this.add(this.monthCont);
              this.add(this.daysOfWeek);
              this.add(this.weekCont);
              this.add(this.events);
              this.add(this.action);
              this.setLayout(new BoxLayout(this,1));
              this.setMaximumSize(new Dimension(400,30));
              this.updateCalendar();
         private void setupActions() {
              this.action.setBorder(BorderFactory.createTitledBorder("Actions"));
              this.action.add(this.add);
              this.action.add(this.edit);
              this.action.add(this.delete);
              this.action.add(this.purge);
              this.action.add(this.mview);
         private void setupEvents() {
              this.events.setBorder(BorderFactory.createTitledBorder("Event Details"));
              this.events.setLayout(new BoxLayout(this.events,1));
              JPanel row1 = new JPanel();
              JPanel row2 = new JPanel();
              JPanel row3 = new JPanel();
              JLabel la = new JLabel("Reference");
              JLabel da = new JLabel("Date");
              JLabel time = new JLabel("Time");
              JLabel det = new JLabel("Details");
              this.ref.setEditable(false);
              this.dateF.setEditable(false);
              this.timeF.setEditable(false);
              this.eventDetails.setEditable(false);
              row1.add(la);
              row1.add(this.ref);
              row1.add(da);
              row1.add(this.dateF);
              row1.add(time);
              row1.add(this.timeF);
              row2.add(det);
              scrollingArea.setPreferredSize(new Dimension(600,50));
              row3.add(this.scrollingArea);
              this.events.add(row1);
              this.events.add(row2);
              this.events.add(row3);
         protected JLabel createUpdateButton(final int field, final int amount, final boolean month) {
             final JLabel label = new JLabel();
             final Border selectedBorder = new EtchedBorder();
             final Border unselectedBorder = new EmptyBorder(selectedBorder.getBorderInsets(new JLabel()));
             label.setBorder(unselectedBorder);
             label.setForeground(foreground);
             label.addMouseListener(new MouseAdapter() {
                  public void mouseReleased(MouseEvent e) {
                   calendar.add(field, amount);
                   if(month){
                   updateMCalendar();}
                   else{
                        updateCalendar();
                   public void mouseEntered(MouseEvent e) {
                   label.setBorder(selectedBorder);
                  public void mouseExited(MouseEvent e) {
                   label.setBorder(unselectedBorder);
             return label;
         private void updateMCalendar() {
              this.calendar.set(Calendar.DAY_OF_MONTH, 1);
              updateCalendar();     
         private void setupHeaders() {
              //MONTH CONTROLS
             monthCont.setLayout(new BoxLayout(monthCont, BoxLayout.X_AXIS));
             monthCont.setBackground(background);
             monthCont.setOpaque(true);
             JLabel label;
             label = createUpdateButton(Calendar.YEAR, -1,false);
             label.setText("<<");
             label.setToolTipText("Previous Year");
             monthCont.add(Box.createHorizontalStrut(12));
             monthCont.add(label);
             monthCont.add(Box.createHorizontalStrut(12));
             label = createUpdateButton(Calendar.MONTH, -1,true);
             label.setText("< ");
             label.setToolTipText("Previous Month");
             monthCont.add(label);
             monthLabel =new JLabel("", JLabel.CENTER);
             monthLabel.setForeground(foreground);
             //monthCont.add(Box.createHorizontalGlue());
             monthCont.add(Box.createHorizontalStrut(12));
             monthCont.add(monthLabel);
             monthCont.add(Box.createHorizontalStrut(12));
             //monthCont.add(Box.createHorizontalGlue());
             label =createUpdateButton(Calendar.MONTH, 1,true);
             label.setText(" >");
             label.setToolTipText("Next Month");
             monthCont.add(label);
             label = createUpdateButton(Calendar.YEAR, 1,false);
             label.setText(">>");
             label.setToolTipText("Next Year");
             monthCont.add(Box.createHorizontalStrut(12));
             monthCont.add(label);
             monthCont.add(Box.createHorizontalStrut(12));
             //WEEK CONTROLS
             weekCont.setLayout(new BoxLayout(weekCont, BoxLayout.X_AXIS));
             weekCont.setBackground(background);
             weekCont.setOpaque(true);
             JLabel label1;
             label1 = createUpdateButton(Calendar.WEEK_OF_MONTH, -1,false);
             label1.setText("<<");
             label1.setToolTipText("Previous Week");
             weekCont.add(label1);
             weekLabel =new JLabel("", JLabel.CENTER);
             weekLabel.setForeground(foreground);
             JLabel lweek =new JLabel("Week:  ", JLabel.CENTER);
             lweek.setForeground(foreground);
             //monthCont.add(Box.createHorizontalGlue());
             weekCont.add(Box.createHorizontalStrut(12));
             weekCont.add(lweek);
             weekCont.add(weekLabel);
             weekCont.add(Box.createHorizontalStrut(12));
             //monthCont.add(Box.createHorizontalGlue());
             label1 = createUpdateButton(Calendar.WEEK_OF_MONTH, 1,false);
             label1.setText(">>");
             label1.setToolTipText("Next Week");
             weekCont.add(label1);
         public void setupDays(){
              monday.setLayout(new BoxLayout(monday,1));
              tuesday.setLayout(new BoxLayout(tuesday,1));
              wednesday.setLayout(new BoxLayout(wednesday,1));
              thursday.setLayout(new BoxLayout(thursday,1));
              friday.setLayout(new BoxLayout(friday,1));
              saturday.setLayout(new BoxLayout(saturday,1));
              sunday.setLayout(new BoxLayout(sunday,1));
              monday.add(this.lmonday);
              monday.add(this.mondayEventsScroll);
              monday.setBorder(BorderFactory.createTitledBorder("Monday"));
              tuesday.add(this.ltuesday);
              tuesday.add(this.tuesdayEventsScroll);
              tuesday.setBorder(BorderFactory.createTitledBorder("Tuesday"));
              wednesday.add(this.lwednesday);
              wednesday.add(this.wednesdayEventsScroll);
              wednesday.setBorder(BorderFactory.createTitledBorder("Wednesday"));
              thursday.add(this.lthursday);
              thursday.add(this.thursdayEventsScroll);
              thursday.setBorder(BorderFactory.createTitledBorder("Thursday"));
              friday.add(this.lfriday);
              friday.add(this.fridayEventsScroll);
              friday.setBorder(BorderFactory.createTitledBorder("Friday"));
              saturday.add(this.lsaturday);
              saturday.add(this.saturdayEventsScroll);
              saturday.setBorder(BorderFactory.createTitledBorder("Saturday"));
              sunday.add(this.lsunday);
              sunday.add(this.sundayEventsScroll);
              sunday.setBorder(BorderFactory.createTitledBorder("Sunday"));
              this.mondayEventsScroll.setPreferredSize(new Dimension(90,200));
              this.monday.setPreferredSize(new Dimension(145,300));
              this.tuesdayEventsScroll.setPreferredSize(new Dimension(90,200));
              this.tuesday.setPreferredSize(new Dimension(145,300));
              this.wednesdayEventsScroll.setPreferredSize(new Dimension(90,200));
              this.wednesday.setPreferredSize(new Dimension(145,300));
              this.thursdayEventsScroll.setPreferredSize(new Dimension(90,200));
              this.thursday.setPreferredSize(new Dimension(145,300));
              this.fridayEventsScroll.setPreferredSize(new Dimension(90,200));
              this.friday.setPreferredSize(new Dimension(145,300));
              this.saturdayEventsScroll.setPreferredSize(new Dimension(90,200));
              this.saturday.setPreferredSize(new Dimension(145,300));
              this.sundayEventsScroll.setPreferredSize(new Dimension(90,200));
              this.sunday.setPreferredSize(new Dimension(145,300));
              daysOfWeek.add(this.sunday);
              daysOfWeek.add(this.monday);
              daysOfWeek.add(this.tuesday);
              daysOfWeek.add(this.wednesday);
              daysOfWeek.add(this.thursday);
              daysOfWeek.add(this.friday);
              daysOfWeek.add(this.saturday);
        private void updateCalendar() {
             monthLabel.setText(monthFormat.format(calendar.getTime()) );
             weekLabel.setText(String.valueOf(this.calendar.get(calendar.WEEK_OF_MONTH)));
             //Blank out / empty strings for first elements that do not start on sunday
             Calendar setupCalendar = (Calendar) calendar.clone();
             setupCalendar.set(Calendar.DAY_OF_WEEK, setupCalendar.getFirstDayOfWeek());
           // while(setupCalendar.get(Calendar.DAY_OF_WEEK) < calendar.getActualMaximum(Calendar.DAY_OF_WEEK)) {
                //System.out.println("day of month: " + setupCalendar.get(Calendar.DAY_OF_MONTH));
                //System.out.println("day of week: " + (setupCalendar.get(Calendar.DAY_OF_WEEK)));
                //System.out.println("week of month: " + calendar.get(Calendar.WEEK_OF_MONTH) + "\n");
                  setDayLabels(setupCalendar.get(Calendar.DAY_OF_MONTH),setupCalendar.get(Calendar.DAY_OF_WEEK));
                setupCalendar.set(Calendar.DAY_OF_WEEK, setupCalendar.get(Calendar.DAY_OF_WEEK) + 1);
                 setDayLabels(setupCalendar.get(Calendar.DAY_OF_MONTH),setupCalendar.get(Calendar.DAY_OF_WEEK));
                setupCalendar.set(Calendar.DAY_OF_WEEK, setupCalendar.get(Calendar.DAY_OF_WEEK) + 1);
                 setDayLabels(setupCalendar.get(Calendar.DAY_OF_MONTH),setupCalendar.get(Calendar.DAY_OF_WEEK));
                setupCalendar.set(Calendar.DAY_OF_WEEK, setupCalendar.get(Calendar.DAY_OF_WEEK) + 1);
                 setDayLabels(setupCalendar.get(Calendar.DAY_OF_MONTH),setupCalendar.get(Calendar.DAY_OF_WEEK));
                setupCalendar.set(Calendar.DAY_OF_WEEK, setupCalendar.get(Calendar.DAY_OF_WEEK) + 1);
                 setDayLabels(setupCalendar.get(Calendar.DAY_OF_MONTH),setupCalendar.get(Calendar.DAY_OF_WEEK));
                setupCalendar.set(Calendar.DAY_OF_WEEK, setupCalendar.get(Calendar.DAY_OF_WEEK) + 1);
                 setDayLabels(setupCalendar.get(Calendar.DAY_OF_MONTH),setupCalendar.get(Calendar.DAY_OF_WEEK));
                setupCalendar.set(Calendar.DAY_OF_WEEK, setupCalendar.get(Calendar.DAY_OF_WEEK) + 1);
                 setDayLabels(setupCalendar.get(Calendar.DAY_OF_MONTH),setupCalendar.get(Calendar.DAY_OF_WEEK));
        public void setDayLabels(int day, int dayOfWeek){
             if(dayOfWeek == 1){
                  this.lsunday.setText(String.valueOf(day));
             if(dayOfWeek == 2){
                  this.lmonday.setText(String.valueOf(day));
             if(dayOfWeek == 3){
                  this.ltuesday.setText(String.valueOf(day));
             if(dayOfWeek == 4){
                  this.lwednesday.setText(String.valueOf(day));
             if(dayOfWeek == 5){
                  this.lthursday.setText(String.valueOf(day));
             if(dayOfWeek == 6){
                  this.lfriday.setText(String.valueOf(day));
             if(dayOfWeek == 7){
                  this.lsaturday.setText(String.valueOf(day));
         @Override
         public void actionPerformed(ActionEvent arg0) {
         @Override
         public void mouseClicked(MouseEvent arg0) {
              // TODO Auto-generated method stub
         @Override
         public void mouseEntered(MouseEvent arg0) {
              // TODO Auto-generated method stub
         @Override
         public void mouseExited(MouseEvent arg0) {
              // TODO Auto-generated method stub
         @Override
         public void mousePressed(MouseEvent arg0) {
              // TODO Auto-generated method stub
         @Override
         public void mouseReleased(MouseEvent arg0) {
              // TODO Auto-generated method stub
         @Override
         public void keyPressed(KeyEvent arg0) {
              // TODO Auto-generated method stub
         @Override
         public void keyReleased(KeyEvent arg0) {
              // TODO Auto-generated method stub
         @Override
         public void keyTyped(KeyEvent arg0) {
              // TODO Auto-generated method stub
         public static void main(String args[]){
              JFrame frame = new JFrame();
              frame.setSize(1100, 670);
              frame.add(new CalendarSystem());
              frame.setVisible(true);
    }Thanks
    Dan

  • Java Calendar problem

    Hello
    I have problems with Java Calendar class:
    Problem 1:
    I try to set Java calendar to specific date, but an exception is thrown. Problematic dates are 19210501 and 19420403 (yyyymmdd) at midnight (hour of day = 0, minutes = 0, seconds = 0, milliseconds = 0). Setting other dates between 15000101 and 22000101 work OK. Exception is thrown when calendar calculates new values. Note that exception is NOT thrown if I do not set hour / minute / second fields!
    Problem 2:
    I set Java calendar to specific date A and convert that date to timeInMillis. Then I set this timeInMillis to calendar and convert it to date B. For certain dates A != B. Problematic dates are 19210501 and 19420403 (yyyymmdd) at midnight (hour of day = 0, minutes = 0, seconds = 0, milliseconds = 0). Setting other dates between 15000101 and 22000101 work OK.
    These problems occur if timeZone = "Europe/Helsinki". Problem does not occur if timeZone = "EET" or "GMT".
    Example code of this problem is below:
    ==================
    package z_javaexperiments5;
    import java.util.Calendar;
    import java.util.TimeZone;
    public class CalendarProblem {
    public static void main(String[] args) {
    CalendarProblem main = new CalendarProblem();
    System.out.println( "RunSetCalendars" );
    TimeZone timeZone = TimeZone.getTimeZone( "GMT" );
    main.runSetCalendars( timeZone, 19420403000000000L );
    main.runSetCalendars( timeZone, 19210501000000000L );
    main.runSetCalendars( timeZone, 19210502000000000L );
    timeZone = TimeZone.getTimeZone( "EET" );
    main.runSetCalendars( timeZone, 19420403000000000L );
    main.runSetCalendars( timeZone, 19210501000000000L );
    main.runSetCalendars( timeZone, 19210502000000000L );
    timeZone = TimeZone.getTimeZone( "Europe/Helsinki" );
    main.runSetCalendars( timeZone, 19420403000000000L );
    main.runSetCalendars( timeZone, 19210501000000000L );
    main.runSetCalendars( timeZone, 19210502000000000L );
    Calendar setCalendar1( TimeZone timeZone, long dateTimeYYYYMMDDHHMMSSsss ) {
    Calendar calendar = Calendar.getInstance(timeZone);
    calendar.clear();
    System.out.println( "setCalendar1 timeZone = " + calendar.getTimeZone().getID());
    int year = (int)( dateTimeYYYYMMDDHHMMSSsss / 10000000000000L );
    int month = (int)(( dateTimeYYYYMMDDHHMMSSsss % 10000000000000L ) / 100000000000L ) - 1;
    int day = (int)(( dateTimeYYYYMMDDHHMMSSsss % 100000000000L ) / 1000000000 );
    int hour = (int)(( dateTimeYYYYMMDDHHMMSSsss % 1000000000 ) / 10000000 );
    int min = (int)(( dateTimeYYYYMMDDHHMMSSsss % 10000000 ) / 100000 );
    int sec = (int)(( dateTimeYYYYMMDDHHMMSSsss % 100000 ) / 1000 );
    int mSec = (int)( dateTimeYYYYMMDDHHMMSSsss % 1000 );
    System.out.println( year + "." + (month+1) + "." + day + " " + hour + ":" + min + ":" + sec + "." + mSec );
    calendar.set( year, month, day );
    calendar.set( Calendar.HOUR_OF_DAY, hour );
    calendar.set( Calendar.MINUTE, min );
    calendar.set( Calendar.SECOND, sec );
    calendar.set( Calendar.MILLISECOND, mSec );
    calendar.setLenient( false ); // Reject illegal values
    try {
    calendar.get( Calendar.SECOND ); // Recalc values
    } catch ( IllegalArgumentException e ) {
    throw new RuntimeException("Invalid argument: Cannot convert long to dateTimeYYYYMMDDHHMMSSsss, long = " + dateTimeYYYYMMDDHHMMSSsss + " Exception message = " + e.getMessage());
    return calendar;
    Calendar setCalendar2( TimeZone timeZone, long dateTimeYYYYMMDDHHMMSSsss ) {
    Calendar calendar = Calendar.getInstance(timeZone);
    System.out.println( "setCalendar2 timeZone = " + calendar.getTimeZone().getID());
    calendar.clear();
    int year = (int)( dateTimeYYYYMMDDHHMMSSsss / 10000000000000L );
    int month = (int)(( dateTimeYYYYMMDDHHMMSSsss % 10000000000000L ) / 100000000000L ) - 1;
    int day = (int)(( dateTimeYYYYMMDDHHMMSSsss % 100000000000L ) / 1000000000 );
    int hour = (int)(( dateTimeYYYYMMDDHHMMSSsss % 1000000000 ) / 10000000 );
    int min = (int)(( dateTimeYYYYMMDDHHMMSSsss % 10000000 ) / 100000 );
    int sec = (int)(( dateTimeYYYYMMDDHHMMSSsss % 100000 ) / 1000 );
    int mSec = (int)( dateTimeYYYYMMDDHHMMSSsss % 1000 );
    System.out.println( "Initial dateTime = " + year + "." + (month+1) + "." + day + " " + hour + ":" + min + ":" + sec + "." + mSec );
    calendar.set( year, month, day );
    if ( hour != 0 )
    calendar.set( Calendar.HOUR_OF_DAY, hour );
    else
    calendar.clear( Calendar.HOUR_OF_DAY );
    if ( min != 0 )
    calendar.set( Calendar.MINUTE, min );
    else
    calendar.clear( Calendar.MINUTE );
    if ( sec != 0 )
    calendar.set( Calendar.SECOND, sec );
    else
    calendar.clear( Calendar.SECOND );
    if ( mSec != 0 )
    calendar.set( Calendar.MILLISECOND, mSec );
    else
    calendar.clear( Calendar.MILLISECOND );
    calendar.setLenient( false ); // Reject illegal values
    try {
    calendar.get( Calendar.SECOND ); // Recalc values
    } catch ( IllegalArgumentException e ) {
    throw new RuntimeException("Invalid argument: Cannot convert long to dateTimeYYYYMMDDHHMMSSsss, long = " + dateTimeYYYYMMDDHHMMSSsss + " Exception message = " + e.getMessage());
    long millis = calendar.getTimeInMillis();
    //System.out.println( "Initial dateTime = " + millis );
    calendar = Calendar.getInstance(timeZone);
    calendar.clear();
    calendar.setTimeInMillis( millis );
    int year2 = calendar.get( Calendar.YEAR );
    int month2 = calendar.get( Calendar.MONTH );
    int day2 = calendar.get( Calendar.DAY_OF_MONTH );
    int hour2 = calendar.get( Calendar.HOUR_OF_DAY );
    int min2 = calendar.get( Calendar.MINUTE );
    int sec2 = calendar.get( Calendar.SECOND );
    int mSec2 = calendar.get( Calendar.MILLISECOND );
    System.out.println( "Final dateTime = " + year2 + "." + (month2+1) + "." + day2 + " " + hour2 + ":" + min2 + ":" + sec2 + "." + mSec2 );
    if (( year != year2 ) || ( month != month2 ) || ( day != day2 ) || ( hour != hour2 ) || ( min != min2 ) || ( sec != sec2 ) || ( mSec != mSec2 ))
    System.out.println( "setCalendar2 failed, dates are not equal" );
    return calendar;
    void runSetCalendars( TimeZone timeZone, long dateTimeYYYYMMDDHHMMSSsss ) {
    System.out.println( "" );
    System.out.println( "runSetCalendars dateTimeYYYYMMDDHHMMSSsss = " + dateTimeYYYYMMDDHHMMSSsss );
    try {
    setCalendar1( timeZone, dateTimeYYYYMMDDHHMMSSsss );
    } catch ( RuntimeException e ) {
    System.out.println( "setCalendar1 failed, dateTimeYYYYMMDDHHMMSSsss = " + dateTimeYYYYMMDDHHMMSSsss + " Exception = " + e.toString());
    Calendar calendar = null;
    try {
    calendar = setCalendar2( timeZone, dateTimeYYYYMMDDHHMMSSsss );
    long timeInMillis = calendar.getTimeInMillis();
    calendar.clear();
    calendar.setTimeInMillis( timeInMillis );
    } catch ( RuntimeException e ) {
    System.out.println( "setCalendar2 failed, dateTimeYYYYMMDDHHMMSSsss = " + dateTimeYYYYMMDDHHMMSSsss + " Exception = " + e.toString());
    ==================
    Program output is below:
    ==================
    RunSetCalendars
    runSetCalendars dateTimeYYYYMMDDHHMMSSsss = 19420403000000000
    setCalendar1 timeZone = GMT
    1942.4.3 0:0:0.0
    setCalendar2 timeZone = GMT
    Initial dateTime = 1942.4.3 0:0:0.0
    Final dateTime = 1942.4.3 0:0:0.0
    runSetCalendars dateTimeYYYYMMDDHHMMSSsss = 19210501000000000
    setCalendar1 timeZone = GMT
    1921.5.1 0:0:0.0
    setCalendar2 timeZone = GMT
    Initial dateTime = 1921.5.1 0:0:0.0
    Final dateTime = 1921.5.1 0:0:0.0
    runSetCalendars dateTimeYYYYMMDDHHMMSSsss = 19210502000000000
    setCalendar1 timeZone = GMT
    1921.5.2 0:0:0.0
    setCalendar2 timeZone = GMT
    Initial dateTime = 1921.5.2 0:0:0.0
    Final dateTime = 1921.5.2 0:0:0.0
    runSetCalendars dateTimeYYYYMMDDHHMMSSsss = 19420403000000000
    setCalendar1 timeZone = EET
    1942.4.3 0:0:0.0
    setCalendar2 timeZone = EET
    Initial dateTime = 1942.4.3 0:0:0.0
    Final dateTime = 1942.4.3 0:0:0.0
    runSetCalendars dateTimeYYYYMMDDHHMMSSsss = 19210501000000000
    setCalendar1 timeZone = EET
    1921.5.1 0:0:0.0
    setCalendar2 timeZone = EET
    Initial dateTime = 1921.5.1 0:0:0.0
    Final dateTime = 1921.5.1 0:0:0.0
    runSetCalendars dateTimeYYYYMMDDHHMMSSsss = 19210502000000000
    setCalendar1 timeZone = EET
    1921.5.2 0:0:0.0
    setCalendar2 timeZone = EET
    Initial dateTime = 1921.5.2 0:0:0.0
    Final dateTime = 1921.5.2 0:0:0.0
    runSetCalendars dateTimeYYYYMMDDHHMMSSsss = 19420403000000000
    setCalendar1 timeZone = Europe/Helsinki
    1942.4.3 0:0:0.0
    setCalendar1 failed, dateTimeYYYYMMDDHHMMSSsss = 19420403000000000 Exception = java.lang.RuntimeException: Invalid argument: Cannot convert long to dateTimeYYYYMMDDHHMMSSsss, long = 19420403000000000 Exception message = HOUR_OF_DAY
    setCalendar2 timeZone = Europe/Helsinki
    Initial dateTime = 1942.4.3 0:0:0.0
    Final dateTime = 1942.4.3 1:0:0.0
    setCalendar2 failed, dates are not equal
    runSetCalendars dateTimeYYYYMMDDHHMMSSsss = 19210501000000000
    setCalendar1 timeZone = Europe/Helsinki
    1921.5.1 0:0:0.0
    setCalendar1 failed, dateTimeYYYYMMDDHHMMSSsss = 19210501000000000 Exception = java.lang.RuntimeException: Invalid argument: Cannot convert long to dateTimeYYYYMMDDHHMMSSsss, long = 19210501000000000 Exception message = MINUTE
    setCalendar2 timeZone = Europe/Helsinki
    Initial dateTime = 1921.5.1 0:0:0.0
    Final dateTime = 1921.5.1 0:20:8.0
    setCalendar2 failed, dates are not equal
    runSetCalendars dateTimeYYYYMMDDHHMMSSsss = 19210502000000000
    setCalendar1 timeZone = Europe/Helsinki
    1921.5.2 0:0:0.0
    setCalendar2 timeZone = Europe/Helsinki
    Initial dateTime = 1921.5.2 0:0:0.0
    Final dateTime = 1921.5.2 0:0:0.0
    ==================
    Why does the program fail when timeZone = "Europe/Helsinki"?

    Could it be related to the time zone changes which occurred at about this time?
    http://www.timeanddate.com/worldclock/clockchange.html?n=101&year=1921

  • Getting Day, month and year from Date object

    hello everybody,
    Date mydate = Resultset.getDate(indexField);
    Now i would like to get day, month and year from mydate.
    In another words, i'm looking for something equivalent to
    mydate.getDay() as this method is deprecated.
    Can somebody help me out please?
    Thank you in advance,

    swvc2000,
    Here is a sample class that demonstrates two ways in which to do this.import java.util.*;
    import java.text.*;
    public class DateSplitter {
       public static void main(String args[]) {
          /* even though your date is from a result set,
             pretend the following date is your date that
             you are using. The try catch block is used
             because I hand-crafted my date using
             SimpleDateFormat.  Substitute your date.*/
          Date yourDate = null;
          try {
             SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
             yourDate = formatter.parse("05/06/2000");
          } catch (ParseException e) { }
          //the following gets the current date
          Calendar c = Calendar.getInstance();
          //use the calendar object to set it to your date
          c.setTime(yourDate);
          //note months start at zero
          int month = c.get(Calendar.MONTH);
          int year = c.get(Calendar.YEAR);
          int dayOfMonth = c.get(Calendar.DAY_OF_MONTH);
          System.out.println("Calendar Month: "+month);
          System.out.println("Calendar Day: "+dayOfMonth);
          System.out.println("Calendar Year: "+year);
          System.out.println();
          /* Simple date format can also be used to strip them
             out of your date object.  When you use it, notice that
             months start at 1.  Also, it returns string values.  If
             you need integer values, you will have to use
             Integer.parseInt() as I did below.  If you are
             only concerned about the string values, just remove
             the Integer.parseInt part. */
          DateFormat formatter = new SimpleDateFormat("M");
          month = Integer.parseInt(formatter.format(yourDate));
          System.out.println("SDF Month: "+ month);
          formatter = new SimpleDateFormat("d");
          dayOfMonth = Integer.parseInt(formatter.format(yourDate));
          System.out.println("SDF Day: "+ dayOfMonth);
          formatter = new SimpleDateFormat("yyyy");
          year = Integer.parseInt(formatter.format(yourDate));
          System.out.println("SDF Year: "+ year);
       }//end main
    }//end DateSplitter classtajenkins

  • How to add get Day value in a Date object?

    Hi,
    I am writing a sql statement that has two date values. One I am getting it from the database. The format in the database is MM/DD/YYYY. My first question is how do I convert the format into the java date format, YYYY-MM-DD. The second question is I need to find out what the day is and add 1 to it. How do I get Day value in a Date object?
    Thanks.

    Look at "SimpleDateFormat" and "parse" in the archives.

  • Question about Sun Java Calendar Server 7

    You downloadable forum, at [http://www.sun.com/software/products/calendar_srvr/get_it.jsp|http://www.sun.com/software/products/calendar_srvr/get_it.jsp],
    leaves one with two questions.
    -What databases are needed/supported by this MessageBoard System for backend storage?
    -What are the licensing details? May the MessageBoard/Communications Suite 7
    be installed and used in a commercial environment, free?
    -May Sun Java Calendar Server 7 be downloaded without the Communications suite?
    -Can it be run off an Apache Tomcat Server with J2SE,J2EE codebases?

    Although... at the top of this forum it says
    This is a forum for new Java developers to get acquainted with the technologies and tools associated with the Java Platform.It doesn't actually say anything about programming, not there nor in what follows. So it isn't surprising that the OP thought this was a suitable forum to ask about that server, which looks as if it might be a "tool associated with the Java platform".

  • How to get days between 2 dates  in jasperreports

    hi All
    i m not getting how to find days b/w 2 dates in jasper reports.....
    here is da detail info....
    i am generating jasper reports for transaction in bank
    i have to get the days b/w current transaction and last transaction dats way its needed
    plz any one help me to get days b/w current and previous transactions...
    i m waiting for ur respone....plz.
    with regards
    kotresh

    take a look at Calendar in the API docs.
    It should give you some ideas.
    If it doesn't, look harder as the answer is right there.

  • Migrate customer defined calendar to Sun Java Calendar

    I am planning to build a XML formated file from my in house build calendar system and use Sun Java Calendar import functionality to import the data to Sun Calendar system.
    following is an sample of an entry by XML
    <EVENT>
         <UID>0000000000000000000000000000000042dd782200002d760000024c000001b8</UID>
         <DTSTAMP>20050725T194431Z</DTSTAMP>
         <SUMMARY>Somthing</SUMMARY>
         <START>20050721T220000Z</START>
         <END>20050721T230000Z</END>
         <CREATED>20050719T220106Z</CREATED>
         <LAST-MOD>20050719T222513Z</LAST-MOD>
         <PRIORITY>5</PRIORITY>
         <SEQUENCE>0</SEQUENCE>
         <DESC>This is a dummy entry 2</DESC>
         <CLASS>PUBLIC</CLASS>
         <LOCATION>401 B</LOCATION>
         <ORGANIZER CN="cal Z (cal)" X-NSCP-ORGANIZER-UID="cal" X-S1CS-EMAIL="[email protected]">cal</ORGANIZER>
         <STATUS>CONFIRMED</STATUS>
         <TRANSP>OPAQUE</TRANSP>
         <X-NSCP-ORIGINAL-DTSTART>20050722T220000Z</X-NSCP-ORIGINAL-DTSTART>
         <X-NSCP-LANGUAGE>en</X-NSCP-LANGUAGE>
         <X-NSCP-DTSTART-TZID>America/Chicago</X-NSCP-DTSTART-TZID>
         <X-NSCP-TOMBSTONE>0</X-NSCP-TOMBSTONE>
         <X-NSCP-ONGOING>0</X-NSCP-ONGOING>
         <X-NSCP-ORGANIZER-EMAIL>[email protected]</X-NSCP-ORGANIZER-EMAIL>
         <X-NSCP-GSE-COMPONENT-STATE X-NSCP-GSE-COMMENT="PUBLISH-COMPLETED">65538</X-NSCP-GSE-COMPONENT-STATE>
    </EVENT>
    Can anybody tell me how can I get a UID?
    What's <X-NSCP-GSE-COMPONENT-STATE X-NSCP-GSE-COMMENT="PUBLISH-COMPLETED">
    What's <DTSTAMP>20050725T194431Z</DTSTAMP>
    Thanks a lot!
    Cal

    Look at RFC2446 it defnes the iCal format.
    On page 58 it states:
    the "DTSTAMP" property specifies the date/time that iCalendar object was created.
    lance

  • Anyone know how java can get html code

    I have this great idea for a program but I need to know how java can get some source code off a web page (HTML) so i can then get certain information from it.
    Then with that certain information on my side can I then like post data through a from like a cgi/php script through a post variable?
    Have any of you heard of something like this?

    you can read the html easy enough, look in the docs for, of all things, objects that have html in their name.
    if you are going to post back then you need an interface to post to--like a servlet--but in any case it has to be supported by the site you want to post back.

  • Java update (3 days ago) won't let me play yahoo games anymore.  I've tried moving java security to Medium and adding web address as "permissive use".  Still nothing.  I'd really like a fix.   Really, apple?  What's your beef with yahoo games?

    Installed Java update three days ago.  Now, can't play yahoo games as it's now blocked by security settings.  Already have tried moving Java security to Medium and adding yahoo.games.com (including web address of game) as a "Permissive exception".   Also tried removing java and installing older version.  Still nothing.  Really Apple?!?  What's your beef with yahoo games? 

    csnorth,
    all of the older update versions of Java SE 7 can be found here. If 7u45 also didn’t work with your Yahoo! games, you can choose from any of the even older versions there as well.

  • Synchronizing Outlook Calendar – Bold days

    Hi!
    When I synchronize the phone (Nokia 9300) with MS Outlook 2000 the appointments are correctly transferred from the phone to the outlook calendar, BUT days with appointments does not show in bold in the outlook calendar.
    However, if the appointment is changed in the outlook calendar (changing the starting time, for instance) and saved after that, the day will then show in bold.
    Does anybody have an idea about how to solve this?
    Thanks!

    Hi guys
    I just "solved" this problem for a client using the information on http://support.microsoft.com/kb/197483:
    - Start Outlook with the flag /cleanfreebusy
    - Bold dates will be fixed
    It seems that the bold dates would only not appear if Outlook was open during the synchronisation, by the way.
    Hope this is helpful to some of you.. Drop a reply with your results!
    Regards,
    stray

  • Restful sample with Java for getting WebI report info in 4.1

    Hi All
    Can anyone give me a sample code in JAVA for getting WebI  report information using Restful services in 4.1 SP1 Version
    Thanks In Advance

    Hi All
    Im unable to execute the below URLs and getting error
    /documents/{documentId}/reports/{reportId}/elements/{elementId}/properties
    /documents/{documentId}/reports/{reportId}/elements/{elementId}/datapaths
    /documents/{documentId}/reports/{reportId}/elements/{elementId}/dataset
    /documents/{documentId}/reports/{reportId}/elements/{elementId}/axes/
    /documents/{documentId}/reports/{reportId}/pages
    /documents/{documentId}/reports/{reportId}/inputcontrols
    /documents/{documentId}/reports/{reportId}/
    Errors:
    Not found. (RWS 00056)
    Not acceptable, (RWS 00058)
    Any Suggestion Please.

  • How to get day of week from NSDate?

    How to get day of week from NSDate?

    Here's a way to get the name of the weekday as an NSString if you've already got an NSDate...
    NSDate * testDate = [NSDate date];
    NSString * weekdayString = [testDate descriptionWithCalendarFormat:@"%A" timeZone:nil
    locale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]];
    NSLog(@"Day of the week: %@", weekdayString);
    The output is something like:
    Day of the week: Monday
    You can use a lower-case "%a" as the descriptionWithCalendarFormat if you just want the three character weekday abbreviation ("Mon", "Tue", "Wed", etc).
    Steve

Maybe you are looking for