Rev 24 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 24 | Rev 30 | ||
---|---|---|---|
1 | package de.viathinksoft.immortable.genX; |
1 | package de.viathinksoft.immortal.genX; |
2 | 2 | ||
3 | import java.text.SimpleDateFormat; |
3 | import java.text.SimpleDateFormat; |
4 | import java.util.Calendar; |
4 | import java.util.Calendar; |
5 | import java.util.Locale; |
5 | import java.util.Locale; |
6 | 6 | ||
7 | /** |
7 | /** |
8 | * @see http://www.rgagnon.com/javadetails/java-0106.html (modified) |
8 | * @see http://www.rgagnon.com/javadetails/java-0106.html (modified) |
9 | */ |
9 | */ |
10 | public class DateUtils { |
10 | public class DateUtils { |
11 | public static String now(String format) { |
11 | public static String now(String format) { |
12 | Calendar cal = Calendar.getInstance(); |
12 | Calendar cal = Calendar.getInstance(); |
13 | Locale lok = Locale.ENGLISH; |
13 | Locale lok = Locale.ENGLISH; |
14 | SimpleDateFormat sdf = new SimpleDateFormat(format, lok); |
14 | SimpleDateFormat sdf = new SimpleDateFormat(format, lok); |
15 | return sdf.format(cal.getTime()); |
15 | return sdf.format(cal.getTime()); |
16 | } |
16 | } |
17 | 17 | ||
18 | private DateUtils() { |
18 | private DateUtils() { |
19 | } |
19 | } |
20 | } |
20 | } |
21 | 21 |