Libraryless. Click here for Pure Java version (9947L/54K).
1 | static long parseWithDateFormats(S s, SimpleDateFormat... formats) ctex { |
2 | if (empty(s)) ret 0; |
3 | fOr (format : formats) try { |
4 | ret format.parse(s).getTime(); |
5 | } catch e {} |
6 | |
7 | fail("Can't parse date", s, "tried formats", formats); |
8 | } |
Began life as a copy of #1014580
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1036510 |
Snippet name: | parseWithDateFormats - try all formats until one works |
Eternal ID of this version: | #1036510/1 |
Text MD5: | ff4c46137ad0558b107f76629c53c329 |
Transpilation MD5: | 9e5a993449e850dfbc95f08f50830bbb |
Author: | stefan |
Category: | javax / calendar |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2023-01-19 15:05:17 |
Source code size: | 246 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 142 / 194 |
Referenced in: | [show references] |