diff options
Diffstat (limited to 'main/src/cgeo/geocaching/utils/SynchronizedDateFormat.java')
| -rw-r--r-- | main/src/cgeo/geocaching/utils/SynchronizedDateFormat.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/utils/SynchronizedDateFormat.java b/main/src/cgeo/geocaching/utils/SynchronizedDateFormat.java new file mode 100644 index 0000000..2368469 --- /dev/null +++ b/main/src/cgeo/geocaching/utils/SynchronizedDateFormat.java @@ -0,0 +1,18 @@ +package cgeo.geocaching.utils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; + +public class SynchronizedDateFormat { + private final SimpleDateFormat format; + + public SynchronizedDateFormat(final String pattern, final Locale locale) { + format = new SimpleDateFormat(pattern, locale); + } + + public synchronized Date parse(final String input) throws ParseException { + return format.parse(input); + } +} |
