Rememberall
Class DateUtils

java.lang.Object
  extended by Rememberall.DateUtils

public class DateUtils
extends java.lang.Object


Method Summary
static boolean areSameDateMinuteGranICalendar(java.lang.String date1, java.lang.String date2)
          This function checks if two dates are the same down to a minute granularity
static java.lang.String convertCalendarToICalendar(java.util.Calendar date)
          This function converts a java.util.Calendar into a String representation of the date in iCalendar format
static java.util.Calendar convertICalendarToCalendar(java.lang.String s)
          This function convertes a String representation of the date in iCalendar format into a Calendar object
static java.lang.String convertICalendarToReadable(java.lang.String s)
          This function takes a String representation of the date in the format yyyymmddThhmmss and converts it to a more readable format
static java.util.Calendar getCurrentDate()
          This returns the current date.
static java.lang.String getCurrentDateStringICalendarFormat()
          This function gets the current date in a specialized string format that iCalendar uses
static int getMinutesFromICalendar(java.lang.String s)
          This function retrieves the number of minutes from an iCalendar date
static void roundCalendarToGran(java.util.Calendar date, int granInSeconds)
          This rounds down the date in a Calendar object to the nearest multiple of the specified number of seconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCurrentDate

public static java.util.Calendar getCurrentDate()
This returns the current date.

Returns:
A java.util.Calendar that represents the current date.

getCurrentDateStringICalendarFormat

public static java.lang.String getCurrentDateStringICalendarFormat()
This function gets the current date in a specialized string format that iCalendar uses

Returns:
String representation of the date in iCalendar date format

convertCalendarToICalendar

public static java.lang.String convertCalendarToICalendar(java.util.Calendar date)
This function converts a java.util.Calendar into a String representation of the date in iCalendar format

Parameters:
date - The date to be converted
Returns:
A String representation of the date in iCalendar format

convertICalendarToReadable

public static java.lang.String convertICalendarToReadable(java.lang.String s)
This function takes a String representation of the date in the format yyyymmddThhmmss and converts it to a more readable format

Parameters:
s - The string to convert
Returns:
A more readable form of the date and time

convertICalendarToCalendar

public static java.util.Calendar convertICalendarToCalendar(java.lang.String s)
This function convertes a String representation of the date in iCalendar format into a Calendar object

Parameters:
s - The String to be converted.
Returns:
A java.util.Calendar representing the date

getMinutesFromICalendar

public static int getMinutesFromICalendar(java.lang.String s)
This function retrieves the number of minutes from an iCalendar date

Parameters:
s - The date to get the minutes from
Returns:
The minutes field of the date

areSameDateMinuteGranICalendar

public static boolean areSameDateMinuteGranICalendar(java.lang.String date1,
                                                     java.lang.String date2)
This function checks if two dates are the same down to a minute granularity

Parameters:
date1 - The first date
date2 - The date to compare against the first date
Returns:
true if the dates are the same date down to a minute granularity

roundCalendarToGran

public static void roundCalendarToGran(java.util.Calendar date,
                                       int granInSeconds)
This rounds down the date in a Calendar object to the nearest multiple of the specified number of seconds. This only works if the number of seconds is less than the number of seconds in an hour.

Parameters:
date - The date to round
granInSeconds - A number of seconds to round the date to a multiple of