MCPcopy Create free account
hub / github.com/PCGen/pcgen / getDate

Method getDate

code/src/java/plugin/lsttokens/SourcedateLst.java:59–89  ·  view source on GitHub ↗
(String value)

Source from the content-addressed store, hash-verified

57 }
58
59 private static Date getDate(String value)
60 {
61 DateFormat df = new SimpleDateFormat("yyyy-MM", Locale.ROOT); //$NON-NLS-1$
62 Date theDate;
63 try
64 {
65 theDate = df.parse(value);
66 }
67 catch (ParseException pe)
68 {
69 df = DateFormat.getDateInstance();
70 try
71 {
72 theDate = df.parse(value);
73 }
74 catch (ParseException e)
75 {
76 try
77 {
78 DateFormat formatter = new SimpleDateFormat("E MMM dd HH:mm:ss Z yyyy", Locale.ROOT);
79 theDate = formatter.parse(value);
80 }
81 catch (ParseException ipe)
82 {
83 Logging.log(Logging.LST_ERROR, "Error parsing date", ipe);
84 return null;
85 }
86 }
87 }
88 return theDate;
89 }
90
91 @Override
92 public String[] unparse(LoadContext context, CDOMObject obj)

Callers 3

parseNonEmptyTokenMethod · 0.95
parseMethod · 0.95
getChronicleValueMethod · 0.45

Calls 2

logMethod · 0.95
parseMethod · 0.65

Tested by

no test coverage detected