You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SSHelpers/Util.java
+32-3Lines changed: 32 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,16 @@
4
4
importjava.util.TimeZone;
5
5
importjava.text.ParseException;
6
6
importjava.text.SimpleDateFormat;
7
-
7
+
/**
8
+
* A utility class containing small helper methods.
9
+
* These methods can be used my importing the class <code>import static SSHelpers.Util.*;</code>
10
+
*
11
+
* @author Sebastian Schmidt
12
+
* @version 1.0 2016-10-18
13
+
* @since 1.0
14
+
*/
8
15
publicclassUtil {
16
+
9
17
/**
10
18
* From a url string get the host-name
11
19
* @param url The Url E.g. http://example.com/foo
@@ -88,6 +96,12 @@ public static String getLocation(String url) {
88
96
returnurl.substring(end);
89
97
}
90
98
99
+
/**
100
+
* Converts a string to a Java date object given the correct format.
101
+
* @param dateStr The string that is parsed as a date.
102
+
* @param format The format as defined in the SimpleDateFormat <a href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html">https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html</a>.
103
+
* @return Returns a new date object. On failure it will return null.
* Converts a Java string object to a string with the given format.
127
+
* @param date The date to format.
128
+
* @param format The format as defined in the SimpleDateFormat <a href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html">https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html</a>.
0 commit comments