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