|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.m2technologies.open_arm.utilities.DateCalendarHelper
Copyright 2005 Mark Masterson
Licensed under the Apache License, Version 2.0 (the "License");
you may
not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Description:
Field Summary | |
static java.lang.String |
DEFAULT_FORMAT_PATTERN
The default formatting pattern to pass to java.text.SimpleDateFormat in order to format a java.util.Calendar as a String |
static java.lang.String |
MILLISEC_TIMESTAMP_FORMAT
Formatting pattern f�r exact timestamps |
Method Summary | |
static java.lang.String |
getCalendarAsString(java.util.Calendar cal)
Takes a java.util.Calendar and returns it as a String, formatted with the DEFAULT_FORMAT_PATTERN. |
static java.lang.String |
getCalendarAsString(java.util.Calendar cal,
java.lang.String formattingPattern)
Takes a java.util.Calendar and returns it as a String, formatted with the pattern given as the second parameter to this method. |
static java.util.Calendar |
getCalendarFromString(java.lang.String dateTimeString)
Takes a String, which should be in the "yyyy-MM-dd HH:mm:ss" format of the DEFAULT_FORMAT_PATTERN constant, and returns a Java Calendar object with the value of the String as the value of the Calendar. |
static java.util.Calendar |
getCalendarFromString(java.lang.String dateTimeString,
java.lang.String pattern)
Takes a String in some format, and a formatting pattern that will be used to parse it, and returns a Calendar with the value of the dateTimeString parameter. |
static java.util.Calendar |
getCalendarFromUnixTime(int unixTime)
Takes an integer value representing the number of seconds since the Epoch (this is variously referred to as "UNIX time" or "C time") and returns a java.util.Calendar instance for the date it represents. |
static java.lang.String |
getDateAsString(java.util.Date date)
Takes a java.util.Date and returns it as a String, formatted with the DEFAULT_FORMAT_PATTERN. |
static java.lang.String |
getDateAsString(java.util.Date date,
java.lang.String formattingPattern)
Takes a java.util.Date and returns it as a String, formatted with the pattern given as the second parameter to this method. |
static java.util.Date |
getDateFromString(java.lang.String dateTimeString)
Takes a String, which should be in the "yyyy-MM-dd HH:mm:ss" format of the DEFAULT_FORMAT_PATTERN constant, and returns a Java Date object with the value of the String as the value of the Date. |
static java.util.Date |
getDateFromString(java.lang.String dateTimeString,
java.lang.String pattern)
Takes a String in some format, and a formatting pattern that will be used to parse it, and returns a Date with the value of the dateTimeString parameter. |
static java.lang.String |
getUnixTimeAsDateString(int unixTime)
Takes an integer value representing the number of seconds since the Epoch (this is variously referred to as "UNIX time" or "C time") and returns it as a String, formatted according to the DEFAULT_FORMAT_PATTERN, for the java.util.Calendar date it represents. |
static int |
getUnixTimeFromCalendar(java.util.Calendar cal)
Takes a java.util.Calendar and returns an integer value representing the number of seconds since the Epoch (this is variously referred to as "UNIX time" or "C time"). |
static java.util.Calendar |
roundTwoCalendarsToDate(java.util.Calendar calendarToChange,
java.util.Calendar referenceCalendar)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_FORMAT_PATTERN
public static final java.lang.String MILLISEC_TIMESTAMP_FORMAT
Method Detail |
public static int getUnixTimeFromCalendar(java.util.Calendar cal)
public static java.util.Calendar getCalendarFromUnixTime(int unixTime)
public static java.lang.String getUnixTimeAsDateString(int unixTime)
public static java.lang.String getCalendarAsString(java.util.Calendar cal)
public static java.lang.String getDateAsString(java.util.Date date)
public static java.lang.String getCalendarAsString(java.util.Calendar cal, java.lang.String formattingPattern)
public static java.lang.String getDateAsString(java.util.Date date, java.lang.String formattingPattern)
public static java.util.Date getDateFromString(java.lang.String dateTimeString)
dateTimeString
-
public static java.util.Date getDateFromString(java.lang.String dateTimeString, java.lang.String pattern)
dateTimeString
- pattern
-
public static java.util.Calendar getCalendarFromString(java.lang.String dateTimeString)
dateTimeString
- Value that should be converted to a Calendar.
public static java.util.Calendar getCalendarFromString(java.lang.String dateTimeString, java.lang.String pattern)
dateTimeString
- Value that should be converted to a Calendar.pattern
- java.util.SimpleDateFormat formatting pattern to use to parse the String value.
public static java.util.Calendar roundTwoCalendarsToDate(java.util.Calendar calendarToChange, java.util.Calendar referenceCalendar)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |