📄 dateformatter.java
字号:
/*
* @author : Pushkala
* @version : 1.0
*
* Development Environment : Oracle9i JDeveloper
*
* Name of the File : DateFormatter.java
*
* Creation / Modification History
* Pushkala 26-Apr-2002 Created
*
*/
package oracle.otnsamples.ibfbs.trademanagement.helper;
import java.util.Date; // Utility Packages
import java.text.SimpleDateFormat; // Date Format
/**
* This class is called from the JSPs to format the Date value
* into a string to be displayed
*
* @version 1.0
* @since 1.0
*/
public class DateFormatter {
/**
* Default empty constructor
* @since 1.0
*/
public DateFormatter() {}
/**
* This method formats the input Date value according to the input format
* and returns the formatted string.
*
* @param inputDate Input Date value
* @param format Format to which the date value has to be converted
* @return The formatted Date string
* @since 1.0
*/
public static String getStringFromDate(Date inputDate, String format) {
String dateFormat = format; // Date Format
SimpleDateFormat formatDate = new SimpleDateFormat(dateFormat);
return formatDate.format(inputDate);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -