Java Utililty Methods Date Format Pattern

List of utility methods to do Date Format Pattern

  1. HOME
  2. Java
  3. D
  4. Date Format Pattern

Description

The list of methods to do Date Format Pattern are organized into topic(s).

Method

DateFormat createFormatter()
This creates a date formatter for yyyy-MM-dd'T'HH:mm:ss'Z' which is has to be identical to buildDate used in pom.xml
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
return df;
DateFormat createFormatter(String str)
Creates a SimpleDateFormat with the UK locale.
DateFormat df = new SimpleDateFormat(str, Locale.UK);
df.setTimeZone(UTC);
return df;
DateFormat createSimpleFormat()
create Simple Format
return new SimpleDateFormat(SIMPLE_DATE_FORMAT);
ThreadLocal createThreadLocal(final String format)
create Thread Local
return new ThreadLocal<SimpleDateFormat>() {
 protected SimpleDateFormat initialValue() {
 return new SimpleDateFormat(format);
 ;
};
SimpleDateFormat get8charDateFormat()
getchar Date Format
return new SimpleDateFormat(format8chars);
SimpleDateFormat getCommandFormat()
A method that returns the date string for the calling command
return COMMAND;
String getDataAtual(String formato)
Retorna a data atual no formato informado.
SimpleDateFormat fm = new SimpleDateFormat(formato);
String data = null;
try {
 data = fm.format(new Date());
} catch (Exception e) {
 System.out.println(e.getMessage());
return data;
...
DateFormat getDataFormatter()
Get a Date formatter for the common API date format
return simpleDateFormat;
SimpleDateFormat getDBFormat()
Returns instance of a SimpleDateFormat where the format has been set to yyyy-MM-dd hh:mm:ss.SSS
SimpleDateFormat format = new SimpleDateFormat("yyyy'-'MM'-'dd HH:mm:ss.SSS");
format.setLenient(false);
return format;
DateFormat getExcelFormat()
get Excel Format
if (xldf == null) {
 xldf = new SimpleDateFormat();
xldf.applyPattern("yyyy-MM-dd HH:mm:ss");
return xldf;


AltStyle によって変換されたページ (->オリジナル) /