org.onebusaway.utility
Class DateLibrary
java.lang.Object
org.onebusaway.utility.DateLibrary
public class DateLibrary
- extends Object
Contains a number of convenience methods for Date
manipulation
- Author:
- bdferris
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DateLibrary
public DateLibrary()
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 objecttimeZone
- 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 DatetimeZone
- 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 © 2012 OneBusAway. All Rights Reserved.