public class ERXTimestampUtilities extends Object
NSTimestamp
utilities.Constructor and Description |
---|
ERXTimestampUtilities() |
Modifier and Type | Method and Description |
---|---|
static GregorianCalendar |
calendarForTimestamp(com.webobjects.foundation.NSTimestamp t) |
static long |
compareDatesInCommonEra(com.webobjects.foundation.NSTimestamp t1,
com.webobjects.foundation.NSTimestamp t2,
int mode) |
static int |
dayOfCommonEra(com.webobjects.foundation.NSTimestamp t) |
static int |
dayOfMonth(com.webobjects.foundation.NSTimestamp t) |
static int |
dayOfWeek(com.webobjects.foundation.NSTimestamp t) |
static int |
dayOfYear(com.webobjects.foundation.NSTimestamp t) |
static long |
differenceByDay(com.webobjects.foundation.NSTimestamp t1,
com.webobjects.foundation.NSTimestamp t2) |
static long |
differenceByMonth(com.webobjects.foundation.NSTimestamp t1,
com.webobjects.foundation.NSTimestamp t2) |
static long |
differenceByWeek(com.webobjects.foundation.NSTimestamp t1,
com.webobjects.foundation.NSTimestamp t2) |
static long |
differenceByYear(com.webobjects.foundation.NSTimestamp t1,
com.webobjects.foundation.NSTimestamp t2) |
static com.webobjects.foundation.NSTimestamp |
epoch()
Utility method used to return the epoch,
Jan 1st, 1970
|
static com.webobjects.foundation.NSTimestamp |
firstDateInNextMonth(com.webobjects.foundation.NSTimestamp value) |
static com.webobjects.foundation.NSTimestamp |
firstDateInSameMonth(com.webobjects.foundation.NSTimestamp value) |
static com.webobjects.foundation.NSTimestamp |
firstDateInSameWeek(com.webobjects.foundation.NSTimestamp value) |
static com.webobjects.foundation.NSTimestampFormatter |
gregorianDateFormatterForJavaDate()
Utility method to return a standard timestamp
formatter for the default string representation
of java dates.
|
static int |
hourOfDay(com.webobjects.foundation.NSTimestamp t) |
static boolean |
isWeekDay(com.webobjects.foundation.NSTimestamp t) |
static int |
minuteOfHour(com.webobjects.foundation.NSTimestamp t) |
static int |
monthOfCommonEra(com.webobjects.foundation.NSTimestamp t) |
static int |
monthOfYear(com.webobjects.foundation.NSTimestamp t) |
static long |
offsetForDateInCommonEra(com.webobjects.foundation.NSTimestamp t,
int mode) |
static int |
secondOfMinute(com.webobjects.foundation.NSTimestamp t) |
static String |
simpleDateFormatForNSTimestampFormat(String timestampFormatterPattern)
Returns the SimpleDateFormat pattern given an NSTimestampFormatter pattern.
|
static com.webobjects.foundation.NSTimestamp |
timestampByAddingTime(com.webobjects.foundation.NSTimestamp ts,
com.webobjects.foundation.NSTimestamp t1)
Adds the time (hours, minutes and seconds) from
the second timestamp to the first timestamp.
|
static com.webobjects.foundation.NSTimestamp |
timestampForString(String defaultValue)
Calculates a timestamp given a string.
|
static com.webobjects.foundation.NSTimestamp |
today()
Timestamp representing today (12:00 AM).
|
static com.webobjects.foundation.NSTimestamp |
tomorrow()
Timestamp representing tomorrow (12:00 AM).
|
static com.webobjects.foundation.NSTimestamp |
unixDate(Number helpedNSNumber)
Converts an offset from the epoch into a
timestamp.
|
static Integer |
unixTimestamp(com.webobjects.foundation.NSTimestamp ts)
Converts a timestamp into the equivalent unix
offset from the epoch.
|
static int |
weekOfCommonEra(com.webobjects.foundation.NSTimestamp t) |
static int |
weekOfMonth(com.webobjects.foundation.NSTimestamp t) |
static int |
weekOfYear(com.webobjects.foundation.NSTimestamp t) |
static int |
yearOfCommonEra(com.webobjects.foundation.NSTimestamp t) |
static com.webobjects.foundation.NSTimestamp |
yesterday()
Timestamp representing yesterday (12:00 AM).
|
public static com.webobjects.foundation.NSTimestamp timestampForString(String defaultValue)
defaultValue
- string given abovepublic static com.webobjects.foundation.NSTimestamp today()
public static com.webobjects.foundation.NSTimestamp tomorrow()
public static com.webobjects.foundation.NSTimestamp yesterday()
public static com.webobjects.foundation.NSTimestamp timestampByAddingTime(com.webobjects.foundation.NSTimestamp ts, com.webobjects.foundation.NSTimestamp t1)
ts
- timestamp to have the time added too.t1
- timestamp to add the time frompublic static com.webobjects.foundation.NSTimestamp epoch()
public static com.webobjects.foundation.NSTimestamp unixDate(Number helpedNSNumber)
helpedNSNumber
- number offset from the epochpublic static Integer unixTimestamp(com.webobjects.foundation.NSTimestamp ts)
ts
- timestamp to be convertedpublic static String simpleDateFormatForNSTimestampFormat(String timestampFormatterPattern)
timestampFormatterPattern
- the NSTimestampFormatter patternpublic static GregorianCalendar calendarForTimestamp(com.webobjects.foundation.NSTimestamp t)
public static long offsetForDateInCommonEra(com.webobjects.foundation.NSTimestamp t, int mode)
public static long differenceByDay(com.webobjects.foundation.NSTimestamp t1, com.webobjects.foundation.NSTimestamp t2)
public static long differenceByWeek(com.webobjects.foundation.NSTimestamp t1, com.webobjects.foundation.NSTimestamp t2)
public static long differenceByMonth(com.webobjects.foundation.NSTimestamp t1, com.webobjects.foundation.NSTimestamp t2)
public static long differenceByYear(com.webobjects.foundation.NSTimestamp t1, com.webobjects.foundation.NSTimestamp t2)
public static com.webobjects.foundation.NSTimestamp firstDateInSameWeek(com.webobjects.foundation.NSTimestamp value)
public static com.webobjects.foundation.NSTimestamp firstDateInSameMonth(com.webobjects.foundation.NSTimestamp value)
public static com.webobjects.foundation.NSTimestamp firstDateInNextMonth(com.webobjects.foundation.NSTimestamp value)
public static long compareDatesInCommonEra(com.webobjects.foundation.NSTimestamp t1, com.webobjects.foundation.NSTimestamp t2, int mode)
public static int dayOfCommonEra(com.webobjects.foundation.NSTimestamp t)
public static int monthOfCommonEra(com.webobjects.foundation.NSTimestamp t)
public static int weekOfCommonEra(com.webobjects.foundation.NSTimestamp t)
public static boolean isWeekDay(com.webobjects.foundation.NSTimestamp t)
public static int dayOfWeek(com.webobjects.foundation.NSTimestamp t)
public static int dayOfMonth(com.webobjects.foundation.NSTimestamp t)
public static int weekOfYear(com.webobjects.foundation.NSTimestamp t)
public static int weekOfMonth(com.webobjects.foundation.NSTimestamp t)
public static int dayOfYear(com.webobjects.foundation.NSTimestamp t)
public static int hourOfDay(com.webobjects.foundation.NSTimestamp t)
public static int minuteOfHour(com.webobjects.foundation.NSTimestamp t)
public static int secondOfMinute(com.webobjects.foundation.NSTimestamp t)
public static int monthOfYear(com.webobjects.foundation.NSTimestamp t)
public static int yearOfCommonEra(com.webobjects.foundation.NSTimestamp t)
public static com.webobjects.foundation.NSTimestampFormatter gregorianDateFormatterForJavaDate()
Copyright © 2002 – 2020 Project Wonder.