Program showing Calendar



Share on Google+Share on Google+

Aarti Katariya
Program showing Calendar
0 Answer(s)      5 years and 8 months ago
Posted in : Java Beginners

package chapter6;

import java.util.Calendar; import java.util.Date; import java.util.Locale;

/** * * @author Dell */ public class dateCurr { public static void main(String[] args) { Date d=new Date(1331096367952L);

 //   System.out.println(d.getTime());

    Calendar c=Calendar.getInstance();

    if(Calendar.SUNDAY == c.getFirstDayOfWeek())
        System.out.println("Sunday is first day of week");

   System.out.println("trillionth milli day of week in month  "+c.get(Calendar.DAY_OF_WEEK_IN_MONTH));

   System.out.println("\ndays in week  "+c.get(Calendar.DAY_OF_WEEK)+"\nDays in year "+c.get(Calendar.DAY_OF_YEAR));

    c.add(Calendar.YEAR, 4);
    Date d1=c.getTime();
    System.out.println("new date"+d1.toString());



run: Wed Mar 07 10:29:27 IST 2012

Sunday is first day of week

trillionth milli day of week in month 1

days in week 4

Days in year 67

new dateMon Mar 07 10:29:27 IST 2016 BUILD SUCCESSFUL (total time: 0 seconds)

View Answers

Related Tutorials/Questions & Answers:
why the program is showing error?
why the program is showing error?  <%@page import="java.sql.*"%> <% try{ Connection conn = null; Class.forName...; It is showing the error: An error occurred at line: 33 in the jsp file
Java Program - Date Calendar
Java Program  A java program that display calendar.  Hi Friend, Try the following code: import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.
Calendar window is not showing the textbox values for the Dynamic rows in html page - Java Interview Questions
Calendar window is not showing the textbox values for the Dynamic rows in html page  My code is here now.When i click on calendar ,value is not showing in textbox please help to me it is very urgent for me Add
calendar  I got one requirement like this i have to display a calendar with only current month and whenever user selects the date, that date needs to be display in a text field
calendar  sir, how to fix calendar in javascript..pls provide the complete source code..   Please visit the following link:
please please i wanna insertion sort program find calendar to array value (1000,5000,10000), please help me
Insertion sort program find calendar to array value 1000,5000,10000  program find calendar for insertion sort in jfram to array 1000
Draw Calendar in SWT
Draw Calendar in SWT       This section illustrates you how to draw  a calendar in SWT, showing current date. SWT allows to create Calendar by using the java.util.Calendar class
calendar - Date Calendar
Creating a Date calendar in Java  I am looking for a code for Creating a Date calendar in Java
j2me code - Date Calendar
j2me code  how to write a calendar program using alert
(Displaying a calendar in GUI
(Displaying a calendar in GUI  (Displaying a calendar) Write a program that displays the calendar for the current month, as Use labels, and set texts on the labels to display the calendar."The Calendar and GregorianCalendar
Showing div at the center of the webpage
Showing div at the center of the webpage  Showing div at the center of the webpage
calendar - Struts
Java calendar example  Please explain the Java calendar example
calendar js
calendar js  there are two calendar on form and i want that once date chosen from first calendar , the second calendar should be disabled till that date. for eg once i have chosen date 21-03-2012 from first calendar
showing the information of database in textbox
showing the information of database in textbox  how to make a information of a database make appear to the user in the textbox
Calendar       In this section we are displaying the days of  a specific month and the calendar... is leap or not. Description of program:  In the given example first we
Java Coding - Date Calendar
1,2005, your program should display the calendar for each month in the year...Java Coding  Write a program that prompts the user to enter the year and first day of the year and displays the calendar for the year on the console
compiled but showing below error
compiled but showing below error  Good morning, By using axis api, am getting the following error but the wsdl file is generating. what is the mistake I done. Unable to find required classes (javax.activation.DataHandler
Java Calendar !?
Java Calendar !?  I need to create a Java Calendar in an Applet. The calendar displays months (jan - dec) in a 3x4 grid ... jan feb march \n april.... so if a user picks the year 2000 show the calendar from that year. So how do i
jframe background color not showing
jframe background color not showing  jframe background color is not showing. please suggest.   Just add the background color to JPanel and then add it to JFrame. For example .. JFrame myFrame = new JFrame(); JPanel
hibernate record not showing in database - Hibernate
hibernate record not showing in database  session =sessionFactory.openSession(); //inserting rocords in Echo Message table...)); //It showing on console Records inserted 21 But not showing in database
class Calendar - Java Beginners
class Calendar  Design the class Calender so that the program can print a calendar for any month starting Junuary 1,1500.Note that the day... Calendar,include the following operations: a.Determine the first day
Java Calendar issue - Date Calendar
Java Calendar issue  Hi I have having weird situation with java Calendar, its driving me crazy. My requirenment is that i got a xml schema element that accepts only Calendar Type Say element 2011-09-25T13:00:00 Say
Calendar Issues
Calendar Issues  I am trying to get this calendar to to display to date selected on a new page. Right now it opens a new page but does not diplay the date from the calendar on the previos page. Here is my code <!DOCTYPE
javascript calendar popup code
javascript calendar popup code  javascript calendar popup code
Operations with Calendar
getDateOfWeekDay(int weekId, int year, int weekDay){ Calendar cal
Calendar Operation
Calendar Operation  I have a date - example - 22-09-2012(start date) I have to find my end date based on the current quarter My input are month of the quarter which is a list box with values(1,2,3) , Day of the month in list
uinavigationcontroller back button not showing/ missing
uinavigationcontroller back button not showing/ missing  Hi, In my application i am calling another view using pushviewcontroller from my root view but ... somehow in the next view uinavigationcontroller back button not showing
event calendar sample
event calendar sample  creating a event calendar for my small app in PHP.. can any one explain about it's design with example php event calendar script
calendar in php code - PHP
calendar in php code   Any Idea to create a calendar for school in PHP? I need a simple nd handy code
Hiding and showing elements on the page
Hiding and showing elements on the page       Hiding and showing elements on the page .hide( ) This method is used to hide the matched elements


Advertisement null