org.fopps.share
Class DateTime

java.lang.Object
  |
  +--java.util.Calendar
        |
        +--java.util.GregorianCalendar
              |
              +--org.fopps.share.DateTime
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class DateTime
extends java.util.GregorianCalendar

A DateTime is a ...

Author:
Oliver Wieland
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.GregorianCalendar
AD, BC
 
Fields inherited from class java.util.Calendar
AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET
 
Constructor Summary
DateTime()
          Creates a DateTime instance with current date and time
DateTime(int year, int month, int date)
           
DateTime(int year, int month, int date, int hour, int minute)
           
DateTime(int year, int month, int date, int hour, int minute, int second)
           
DateTime(java.util.Locale aLocale)
           
DateTime(java.util.TimeZone zone)
           
DateTime(java.util.TimeZone zone, java.util.Locale aLocale)
           
 
Method Summary
 void addDay()
          Adds one day to the current DateTime instance
 void addDay(int amount)
          Adds a given number of days to the current DateTime instance.
 void addMonth()
          Adds one month to the current DateTime instance
 void addMonth(int amount)
          Adds a given number of months to the current DateTime instance.
 void addWeek()
          Adds one week to the current DateTime instance
 void addWeek(int amount)
          Adds a given number of weeks to the current DateTime instance.
 int getDayOfMonth()
          Returns the day of month of the current DateTime instance
 int getDayOfWeek()
          Returns the day of month of the current DateTime instance
 int getMonth()
          Returns the month of the current DateTime instance
 long getTimeMillis()
          Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT
 int getWeekOfYear()
          Returns the day of month of the current DateTime instance
 int getYear()
          Returns the year of the current DateTime instance
static void main(java.lang.String[] args)
           
 java.lang.String toString()
          Return a string representation of this calendar.
 
Methods inherited from class java.util.GregorianCalendar
add, computeFields, computeTime, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, hashCode, isLeapYear, roll, roll, setGregorianChange
 
Methods inherited from class java.util.Calendar
after, before, clear, clear, clone, complete, get, getAvailableLocales, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, getTimeZone, internalGet, isLenient, isSet, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, setTimeZone
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateTime

public DateTime()
Creates a DateTime instance with current date and time


DateTime

public DateTime(java.util.TimeZone zone)

DateTime

public DateTime(java.util.Locale aLocale)

DateTime

public DateTime(java.util.TimeZone zone,
                java.util.Locale aLocale)

DateTime

public DateTime(int year,
                int month,
                int date)

DateTime

public DateTime(int year,
                int month,
                int date,
                int hour,
                int minute)

DateTime

public DateTime(int year,
                int month,
                int date,
                int hour,
                int minute,
                int second)
Method Detail

getYear

public int getYear()
Returns the year of the current DateTime instance


getMonth

public int getMonth()
Returns the month of the current DateTime instance


getDayOfMonth

public int getDayOfMonth()
Returns the day of month of the current DateTime instance


getDayOfWeek

public int getDayOfWeek()
Returns the day of month of the current DateTime instance


getWeekOfYear

public int getWeekOfYear()
Returns the day of month of the current DateTime instance


getTimeMillis

public long getTimeMillis()
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT


addWeek

public void addWeek(int amount)
Adds a given number of weeks to the current DateTime instance. Negative numbers are allowed.


addWeek

public void addWeek()
Adds one week to the current DateTime instance


addMonth

public void addMonth(int amount)
Adds a given number of months to the current DateTime instance. Negative numbers are allowed.


addMonth

public void addMonth()
Adds one month to the current DateTime instance


addDay

public void addDay(int amount)
Adds a given number of days to the current DateTime instance. Negative numbers are allowed.


addDay

public void addDay()
Adds one day to the current DateTime instance


toString

public java.lang.String toString()
Return a string representation of this calendar. This method is intended to be used only for debugging purposes, and the format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
toString in class java.util.Calendar
Returns:
a string representation of this calendar.

main

public static void main(java.lang.String[] args)


Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.