org.onebusaway.utility
Class DateLibrary

java.lang.Object
  extended by org.onebusaway.utility.DateLibrary

public class DateLibrary
extends Object

Contains a number of convenience methods for Date manipulation

Author:
bdferris

Constructor Summary
DateLibrary()
           
 
Method Summary
static Date getIso8601StringAsTime(String value)
           
static Date getIso8601StringAsTime(String value, TimeZone timeZone)
           
static Date getTimeAsDay(Date t)
           
static Date getTimeAsDay(long t)
           
static String getTimeAsIso8601String(Date date)
           
static String getTimeAsIso8601String(Date date, TimeZone timeZone)
           
static boolean hasAmPmClock(Locale locale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateLibrary

public DateLibrary()
Method Detail

getTimeAsIso8601String

public static String getTimeAsIso8601String(Date date)
Parameters:
date - a target Date object
Returns:
an ISO 8601 string representation of a Date

getTimeAsIso8601String

public static String getTimeAsIso8601String(Date date,
                                            TimeZone timeZone)
Parameters:
date - a target Date object
timeZone - the target timezone for the ISO 8601 representation
Returns:
an ISO 8601 string representation of a Date

getIso8601StringAsTime

public static Date getIso8601StringAsTime(String value)
                                   throws ParseException
Parameters:
value - an ISO 8601 string representation fo a Date
Returns:
a parsed Date object
Throws:
ParseException - if there is an error parsing the string

getIso8601StringAsTime

public static Date getIso8601StringAsTime(String value,
                                          TimeZone timeZone)
                                   throws ParseException
Parameters:
value - an ISO 8601 string representation fo a Date
timeZone - the target timezone for the ISO 8601 representation
Returns:
a parsed Date object
Throws:
ParseException - if there is an error parsing the string

getTimeAsDay

public static Date getTimeAsDay(Date t)

getTimeAsDay

public static Date getTimeAsDay(long t)

hasAmPmClock

public static boolean hasAmPmClock(Locale locale)


Copyright © 2011 OneBusAway. All Rights Reserved.