(Object ts, Object infix)
| 208 | } |
| 209 | |
| 210 | public static String yymmdd(Object ts, Object infix) { |
| 211 | String sep = (infix == null) ? "-" : String.valueOf(infix); |
| 212 | if (ts == null) return null; |
| 213 | try { |
| 214 | long ms = Long.parseLong(String.valueOf(ts)); |
| 215 | Instant inst = Instant.ofEpochMilli(ms); |
| 216 | DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yy" + sep + "MM" + sep + "dd") |
| 217 | .withZone(ZoneOffset.UTC); |
| 218 | return fmt.format(inst); |
| 219 | } catch (Exception ignored) { |
| 220 | // match the C# version which swallows and returns empty string on failure |
| 221 | return ""; |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | public static String yymmdd(Object ts) { |
| 226 | return yymmdd(ts, ""); |
no test coverage detected