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