Produced by Araxis Merge on 6/20/2018 10:24:20 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | CCRS.zip\CCRS\Reports-Sprint_5.zip\Reports-Sprint_5-aa03f94869cda45ee08ca75641e61a7376f2c2a5\CCRSBaseHelper\src\main\java\gov\va\ccrs\helpers | DateHelper.java | Fri Mar 30 15:47:12 2018 UTC |
2 | CCRS.zip\CCRS\Reports-Sprint_5.zip\Reports-Sprint_5-aa03f94869cda45ee08ca75641e61a7376f2c2a5\CCRSBaseHelper\src\main\java\gov\va\ccrs\helpers | DateHelper.java | Fri Jun 15 13:10:51 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 182 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | package go v.va.ccrs. helpers; | |
2 | ||
3 | import jav a.text.Sim pleDateFor mat; | |
4 | import jav a.util.Dat e; | |
5 | ||
6 | /** | |
7 | * | |
8 | * Helper to handle dates conv ersions fr om String to Date an d vice ver sa (with f ormat) | |
9 | * | |
10 | * @author pi i
|
|
11 | * @versio n 1 | |
12 | * @since 11/22/2017 | |
13 | * | |
14 | */ | |
15 | ||
16 | public cla ss DateHel per | |
17 | { | |
18 | /** | |
19 | * | |
20 | * Con verts a Da te into a String wit h the defa ult local format | |
21 | * | |
22 | * @pa ram date | |
23 | * @re turn | |
24 | */ | |
25 | public static St ring toStr ing(Date d ate) | |
26 | { | |
27 | St ring strDa te = ""; | |
28 | ||
29 | if (date != n ull) | |
30 | { | |
31 | strDate = date.toS tring(); | |
32 | } | |
33 | ||
34 | re turn(strDa te); | |
35 | } | |
36 | ||
37 | /** | |
38 | * | |
39 | * Con verts a Da te into a String wit h using th e provided date form at | |
40 | * | |
41 | * @pa ram date | |
42 | * @pa ram format | |
43 | * @re turn | |
44 | */ | |
45 | public static St ring toStr ing(Date d ate, Strin g format) | |
46 | { | |
47 | St ring strDa te = ""; | |
48 | ||
49 | tr y | |
50 | { | |
51 | if (date != null) | |
52 | { | |
53 | strD ate = new SimpleDate Format("yy y-MM-dd"). format(dat e); | |
54 | } | |
55 | } | |
56 | ca tch (Excep tion ex) | |
57 | { | |
58 | strDate = ""; | |
59 | // throw ex; | |
60 | } | |
61 | ||
62 | re turn(strDa te); | |
63 | } | |
64 | ||
65 | /** | |
66 | * | |
67 | * Con verts a St ring into a date usi ng the pro vided date format | |
68 | * | |
69 | * @pa ram strDat e | |
70 | * @pa ram format | |
71 | * @re turn | |
72 | */ | |
73 | public static Da te toDate( String str Date, Stri ng format) | |
74 | { | |
75 | Da te date = null; | |
76 | ||
77 | tr y | |
78 | { | |
79 | if (strD ate.length () > 0) | |
80 | { | |
81 | date = new Sim pleDateFor mat("yyy-M M-dd").par se(strDate ); | |
82 | } | |
83 | } | |
84 | ca tch (Excep tion ex) | |
85 | { | |
86 | date = n ull; | |
87 | // throw ex; | |
88 | } | |
89 | ||
90 | re turn(date) ; | |
91 | } | |
92 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.