public interface AQDateFactory
AQDate
date objects.
An instance of this interface is available via aqua.type.date alias.
Modifier and Type | Method and Description |
---|---|
AQDataSet |
adjustTimeZone(AQDataSet dataSet,
String srcTimeZone,
String destTimeZone)
This method creates a new data set instance with dates shifted to a new time zone.
|
String |
format(Object date,
String pattern,
Object timezone)
Converts the specified date to a string according to the format pattern, time zone provided.
|
String |
format(Object date,
String pattern,
Object timezone,
Object locale)
Converts the specified date to a string according to the format pattern, time zone, and locale provided.
|
boolean |
isEarlier(AQDate a,
AQDate b)
Returns true if the date specified in parameter
a is earlier
than the date specified in parameter b . |
boolean |
isInRange(AQDate date,
AQDate start,
AQDate end)
Returns true if the date is within the specified range (start...end, inclusive).
|
boolean |
isLater(AQDate a,
AQDate b)
Returns true if the date specified in parameter
a is later
than the date specified in parameter b . |
boolean |
isValid(String date,
String pattern)
Returns true if the specified date string can be parsed to a valid date using the pattern provided.
|
AQDate |
newDate()
Creates a new date object initialized with the current platform time, locale, and time zone.
|
AQDate |
newDate(int year,
int month,
int day)
Creates a new date object initialized with the specified date,
using platform locale and time zone.
|
AQDate |
newDate(int year,
int month,
int day,
int hours,
int minutes,
int seconds,
Object timezone)
Creates a new date object initialized with the specified date, time, and time zone;
using platform locale.
|
AQDate |
newDate(int year,
int month,
int day,
int hours,
int minutes,
Object timezone)
Creates a new date object initialized with the specified date and time,
using platform locale and time zone.
|
AQDate |
newDate(int year,
int month,
int day,
Object timezone)
Creates a new date object initialized with the specified date,
using platform locale and the specified time zone.
|
AQDate |
newDate(long time,
Object timezone)
Creates a new date object initialized with the specified time, and time zone;
using platform locale.
|
AQDate |
parse(String date,
String pattern,
Object timezone)
Creates a new date object by parsing the specified date string using the specified
pattern.
|
AQDate |
parse(String date,
String pattern,
String timezone,
String locale)
Creates a new date object by parsing the specified date string using the specified
pattern.
|
AQDate newDate()
AQDate newDate(long time, Object timezone)
time
- UTC Time in milliseconds since January 1, 1970 00:00:00.000 GMTtimezone
- Time zone specification as defined in TimeZone
. Example: "GMT-08:00"AQDate newDate(int year, int month, int day)
year
- Gregorian calendar yearmonth
- Month (January is 1)day
- Day of monthAQDate newDate(int year, int month, int day, Object timezone)
year
- Gregorian calendar yearmonth
- Month (January is 1)day
- Day of monthtimezone
- Time zone specification as defined in TimeZone
. Example: "GMT-08:00"AQDate newDate(int year, int month, int day, int hours, int minutes, Object timezone)
year
- Gregorian calendar yearmonth
- Month (January is 1)day
- Day of monthhours
- Hour of day (0..23)minutes
- Minutes (0..59)timezone
- Time zone specification as defined in TimeZone
. Example: "GMT-08:00"AQDate newDate(int year, int month, int day, int hours, int minutes, int seconds, Object timezone)
year
- Gregorian calendar yearmonth
- Month (January is 1)day
- Day of monthhours
- Hour of day (0..23)minutes
- Minutes (0..59)seconds
- Seconds (0..59)timezone
- Time zone specification as defined in TimeZone
. Example: "GMT-08:00"AQDate parse(String date, String pattern, Object timezone) throws Exception
date
- Date stringpattern
- Pattern string as specified in SimpleDateFormat
. Example: "yyyy/MM/dd HH.mm.ss"timezone
- Time zone specification as defined in TimeZone
. Example: "GMT-08:00"Exception
- If the date string specified cannot be parsed.AQDate parse(String date, String pattern, String timezone, String locale) throws Exception
date
- Date stringpattern
- Pattern string as specified in SimpleDateFormat
. Example: "yyyy/MM/dd HH.mm.ss"timezone
- Time zone specification as defined in TimeZone
. Example: "GMT-08:00"locale
- Locale string as specified in Locale
. Example: "en_US"Exception
- If the date string specified cannot be parsed.boolean isValid(String date, String pattern)
date
- Date string.pattern
- Pattern as specified in SimpleDateFormat
. Example: "yyyy/MM/dd HH.mm.ss"boolean isInRange(AQDate date, AQDate start, AQDate end)
date
- the specified datestart
- Start of the date interval.end
- End of the date interval.boolean isEarlier(AQDate a, AQDate b)
a
is earlier
than the date specified in parameter b
.a
- The date specified.b
- The date to be compared.boolean isLater(AQDate a, AQDate b)
a
is later
than the date specified in parameter b
.a
- The date specified.b
- The date to be compared.String format(Object date, String pattern, Object timezone)
date
- Date (either an AQDate
or Date
objectpattern
- Pattern as specified in SimpleDateFormat
. Example: "yyyy/MM/dd HH.mm.ss"timezone
- Time zone specification as defined in TimeZone
. Example: "GMT-08:00"String format(Object date, String pattern, Object timezone, Object locale)
date
- Date (either an AQDate
or Date
objectpattern
- Pattern as specified in SimpleDateFormat
. Example: "yyyy/MM/dd HH.mm.ss"timezone
- Time zone specification as defined in TimeZone
. Example: "GMT-08:00"locale
- Locale string as specified in Locale
. Example: "en_US"AQDataSet adjustTimeZone(AQDataSet dataSet, String srcTimeZone, String destTimeZone) throws Exception
Date
or AQDate
) in the copy.dataSet
- Original data set.srcTimeZone
- Original data set time zone.destTimeZone
- Target time zone.Exception
- on error
Copyright © 2017 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.