import java.util.*;
import java.awt.*;

//A useful class contag the present date. It also contains useful functions
//used many times to create the calendar such as conversions between strings
//and ints for the days of the week and the months of the year

public class TodaysDate {

  TodaysDate()
  {
    Year curYear = new Year();
    GregorianCalendar cal = new GregorianCalendar(); 

    day = cal.get(Calendar.DAY_OF_WEEK);
    date = cal.get(Calendar.DATE);
    month = cal.get(Calendar.MONTH);
    year = cal.get(Calendar.YEAR);

    fullDate = (Integer.toString(year)) 
      + " " + (Integer.toString(month)) 
      + " " + (Integer.toString(date));

    Date trialTime = new Date();
    cal.setTime(trialTime);
    fullTime = (cal.get(Calendar.HOUR)   + ":" +
                cal.get(Calendar.MINUTE) + ":" +
                cal.get(Calendar.SECOND));
 
    GregorianCalendar firstCalendar = new GregorianCalendar(
				year,
				month,
				1);
    
    firstDayOfMonth = firstCalendar.get(Calendar.DAY_OF_WEEK);
    nDaysInMonth = curYear.getNumDaysInMonth(month);

  }
  public int getfirstDayOfMonth()
  {
    return firstDayOfMonth;
  }
  public int getnDaysInMonth()
  {
    return nDaysInMonth;
  }
  public int getCurrentYear()
  {
    return year;
  }
  public int getCurrentMonth()
  {
    return month;
  }
  public int getCurrentDate()
  {
    return date;
  }
  public String getFullDate()
  {
    return fullDate;
  }
  public String getFullTime()
  {
    return fullTime;
  }
  public int getCurrentDay()
  {
    return day;
  }
  
  public String intToMonth(int month)
  {
    String word;
    word = "Month";
    if (month==0)
      word= "January";
    if (month==1)
      word= "February";
    if (month==2)
      word = "March";
    if (month==3)
      word = "April";
    if (month==4)
      word = "May";
    if (month==5)
      word = "June";
    if (month==6)
      word = "July";
    if (month==7)
      word = "August";
    if (month==8)
      word = "September";
    if (month==9)
      word = "Ocober";
    if (month==10)
      word = "November";
    if (month==11)
      word = "December";
    return word;




  }
  public int dayToInt(String day)
  {
    if(day.equals("Sunday"))
      return 0;
    else if(day.equals("Monday"))
      return 1;
    else if(day.equals("Tuesday"))
      return 2;
    else if(day.equals("Wednesday"))
      return 3;
    else if(day.equals("Thursday"))
      return 4;
    else if(day.equals("Friday"))
      return 5;
    else if(day.equals("Saturday"))
      return 6;
    else 
      {
	
	System.out.println("can't convert day to int");

      }
     return 0;
  }
  
  private int nDaysInMonth;
  private int firstDayOfMonth;
  
  private String fullDate;
  private String fullTime;
  private int day;
  private int year;
  private int month;
  private int date;


}
