com.aiyc.framework.utils
类 DateUtil

java.lang.Object
  继承者 com.aiyc.framework.utils.DateUtil
所有已实现的接口:
Serializable

public class DateUtil
extends Object
implements Serializable

Date Utility Class This is used to convert Strings to Dates and Timestamps

另请参见:
序列化表格

构造方法摘要
DateUtil()
           
 
方法摘要
static String convertDateToString(Date aDate)
          This method generates a string representation of a date based on the System Property 'dateFormat' in the format you specify on input
static Date convertStringToDate(String strDate)
          This method converts a String to a date using the datePattern
static Date convertStringToDate(String aMask, String strDate)
          This method generates a string representation of a date/time in the format you specify on input
static String DateTimeToISOStr(Date date)
           
static String DateTimeToStr(Date date)
           
static String DateTimeToStr(Date date, char c)
           
static String DateTimeToStr(Date date, char c, char c1, char c2)
           
static String getDate(Date aDate)
          This method attempts to convert an Oracle-formatted date in the form dd-MMM-yyyy to mm/dd/yyyy.
static String getDatePattern()
          Return default datePattern (yyyy-MM-dd)
static String getDateTime(String aMask, Date aDate)
          This method generates a string representation of a date's date/time in the format you specify on input
static String getDateTimePattern()
           
static String getTimeNow(Date theTime)
          This method returns the current date time in the format: MM/dd/yyyy HH:MM a
static Calendar getToday()
          This method returns the current date in the format: MM/dd/yyyy
static Date StrToDate(String s)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

DateUtil

public DateUtil()
方法详细信息

StrToDate

public static Date StrToDate(String s)

DateTimeToStr

public static String DateTimeToStr(Date date)

DateTimeToISOStr

public static String DateTimeToISOStr(Date date)

DateTimeToStr

public static String DateTimeToStr(Date date,
                                   char c,
                                   char c1,
                                   char c2)

DateTimeToStr

public static String DateTimeToStr(Date date,
                                   char c)

getDatePattern

public static String getDatePattern()
Return default datePattern (yyyy-MM-dd)

返回:
a string representing the date pattern on the UI

getDateTimePattern

public static String getDateTimePattern()

getDate

public static final String getDate(Date aDate)
This method attempts to convert an Oracle-formatted date in the form dd-MMM-yyyy to mm/dd/yyyy.

参数:
aDate - date from database as a string
返回:
formatted string for the ui

convertStringToDate

public static final Date convertStringToDate(String aMask,
                                             String strDate)
                                      throws ParseException
This method generates a string representation of a date/time in the format you specify on input

参数:
aMask - the date pattern the string is in
strDate - a string representation of a date
返回:
a converted Date object
抛出:
ParseException
另请参见:
SimpleDateFormat

getTimeNow

public static String getTimeNow(Date theTime)
This method returns the current date time in the format: MM/dd/yyyy HH:MM a

参数:
theTime - the current time
返回:
the current date/time

getToday

public static Calendar getToday()
                         throws ParseException
This method returns the current date in the format: MM/dd/yyyy

返回:
the current date
抛出:
ParseException

getDateTime

public static final String getDateTime(String aMask,
                                       Date aDate)
This method generates a string representation of a date's date/time in the format you specify on input

参数:
aMask - the date pattern the string is in
aDate - a date object
返回:
a formatted string representation of the date
另请参见:
SimpleDateFormat

convertDateToString

public static final String convertDateToString(Date aDate)
This method generates a string representation of a date based on the System Property 'dateFormat' in the format you specify on input

参数:
aDate - A date to convert
返回:
a string representation of the date

convertStringToDate

public static Date convertStringToDate(String strDate)
                                throws ParseException
This method converts a String to a date using the datePattern

参数:
strDate - the date to convert (in format MM/dd/yyyy)
返回:
a date object
抛出:
ParseException


Copyright © 2017. All Rights Reserved.