1
22
23 package com.liferay.portal.kernel.util;
24
25 import java.text.DateFormat;
26
27 import java.util.Locale;
28 import java.util.TimeZone;
29
30
35 public class DateFormatFactoryUtil {
36
37 public static DateFormat getDate(Locale locale) {
38 return getDateFormatFactory().getDate(locale);
39 }
40
41 public static DateFormat getDate(Locale locale, TimeZone timeZone) {
42 return getDateFormatFactory().getDate(locale, timeZone);
43 }
44
45 public static DateFormat getDate(TimeZone timeZone) {
46 return getDateFormatFactory().getDate(timeZone);
47 }
48
49 public static DateFormat getDateTime(Locale locale) {
50 return getDateFormatFactory().getDateTime(locale);
51 }
52
53 public static DateFormat getDateTime(Locale locale, TimeZone timeZone) {
54 return getDateFormatFactory().getDateTime(locale, timeZone);
55 }
56
57 public static DateFormat getDateTime(TimeZone timeZone) {
58 return getDateFormatFactory().getDateTime(timeZone);
59 }
60
61 public static DateFormatFactory getDateFormatFactory() {
62 return _fastDateFormatFactory;
63 }
64
65 public static DateFormat getSimpleDateFormat(String pattern) {
66 return getDateFormatFactory().getSimpleDateFormat(pattern);
67 }
68
69 public static DateFormat getSimpleDateFormat(
70 String pattern, Locale locale) {
71
72 return getDateFormatFactory().getSimpleDateFormat(pattern, locale);
73 }
74
75 public static DateFormat getSimpleDateFormat(
76 String pattern, Locale locale, TimeZone timeZone) {
77
78 return getDateFormatFactory().getSimpleDateFormat(
79 pattern, locale, timeZone);
80 }
81
82 public static DateFormat getSimpleDateFormat(
83 String pattern, TimeZone timeZone) {
84
85 return getDateFormatFactory().getSimpleDateFormat(
86 pattern, timeZone);
87 }
88
89 public static DateFormat getTime(Locale locale) {
90 return getDateFormatFactory().getTime(locale);
91 }
92
93 public static DateFormat getTime(Locale locale, TimeZone timeZone) {
94 return getDateFormatFactory().getTime(locale, timeZone);
95 }
96
97 public static DateFormat getTime(TimeZone timeZone) {
98 return getDateFormatFactory().getTime(timeZone);
99 }
100
101 public void setDateFormatFactory(
102 DateFormatFactory fastDateFormatFactory) {
103
104 _fastDateFormatFactory = fastDateFormatFactory;
105 }
106
107 private static DateFormatFactory _fastDateFormatFactory;
108
109 }