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
{{ message }}
This repository was archived by the owner on Dec 12, 2018. It is now read-only.
@@ -41,6 +66,7 @@ public static long convertDateToLocalTime(long time, TimeZone to) {
41
66
42
67
/**
43
68
* Converts a given time from the specified {@link TimeZone} to the corresponding UTC (Coordinated Universal Time) time
69
+
*
44
70
* @param time the instant to convert, represented as the number of milliseconds that have elapsed since midnight, January 1, 1970
45
71
* @param from the original {@link TimeZone}
46
72
* @return the UTC instant, represented as the number of milliseconds that have elapsed since midnight, January 1, 1970
@@ -51,9 +77,10 @@ public static long convertDateToUTC(long time, TimeZone from) {
51
77
52
78
/**
53
79
* Converts a given time from a {@link TimeZone} to another
80
+
*
54
81
* @param time the instant to convert, represented as the number of milliseconds that have elapsed since midnight, January 1, 1970 in the {@code from} {@link TimeZone}
55
82
* @param from the original {@link TimeZone}
56
-
* @param to the target {@link TimeZone} for the conversion
83
+
* @param to the target {@link TimeZone} for the conversion
57
84
* @return the long representation of the instant converted to the specified {@code to} {@link TimeZone}
@@ -64,10 +91,10 @@ public static long convertDate(long time, TimeZone from, TimeZone to) {
64
91
* Creates an UTC-based {@Link Date} using the provided {@code year}.
65
92
* Uses the current date and time, sets the specified {@code year} and returns the Date converted to a UTC timestamp.
66
93
*
67
-
* @param year the year to represent
94
+
* @param year the year to represent
68
95
* @return the UTC-based {@link Date}
69
96
*/
70
-
publicstaticDateof(intyear){
97
+
publicstaticDateof(intyear){
71
98
GregorianCalendarcal = newGregorianCalendar();
72
99
cal.set(Calendar.YEAR, year);
73
100
TimeZonefromTimeZone = cal.getTimeZone();
@@ -79,10 +106,10 @@ public static Date of(int year){
79
106
* Uses the current date and time, sets the specified {@code year} and {@code month}, and returns the Date converted to a UTC timestamp.
80
107
*
81
108
* @param year the year to represent
82
-
* @param month the month-of-year to represent, from 0 (January) to 11 (December)
109
+
* @param month the month-of-year to represent, from 0 (January) to 11 (December)
83
110
* @return the UTC-based {@link Date}
84
111
*/
85
-
publicstaticDateof(intyear, intmonth){
112
+
publicstaticDateof(intyear, intmonth){
86
113
Assert.isTrue(0 <= month && month <= 11, "month param must be a value from 0 (January) to 11 (December)");
87
114
GregorianCalendarcal = newGregorianCalendar();
88
115
cal.set(Calendar.YEAR, year);
@@ -96,11 +123,11 @@ public static Date of(int year, int month){
96
123
* Uses the current date and time, sets the specified {@code year}, {@code month} and {@code day}, and returns the Date converted to a UTC timestamp.
97
124
*
98
125
* @param year the year to represent
99
-
* @param month the month-of-year to represent, from 0 (January) to 11 (December)
100
-
* @param day the day-of-month to represent, from 1 to 31
126
+
* @param month the month-of-year to represent, from 0 (January) to 11 (December)
127
+
* @param day the day-of-month to represent, from 1 to 31
101
128
* @return the UTC-based {@link Date}
102
129
*/
103
-
publicstaticDateof(intyear, intmonth, intday){
130
+
publicstaticDateof(intyear, intmonth, intday){
104
131
Assert.isTrue(0 <= month && month <= 11, "month param must be a value from 0 (January) to 11 (December)");
105
132
Assert.isTrue(1 <= day && day <= 31, "day param must be a value from 1 to 31");
106
133
GregorianCalendarcal = newGregorianCalendar();
@@ -116,12 +143,12 @@ public static Date of(int year, int month, int day){
116
143
* Uses the current date and time, sets the specified {@code year}, {@code month}, {@code day} and {@code hour}, and returns the Date converted to a UTC timestamp.
117
144
*
118
145
* @param year the year to represent
119
-
* @param month the month-of-year to represent, from 0 (January) to 11 (December)
120
-
* @param day the day-of-month to represent, from 1 to 31
146
+
* @param month the month-of-year to represent, from 0 (January) to 11 (December)
147
+
* @param day the day-of-month to represent, from 1 to 31
121
148
* @param hour the hour-of-day to represent, from 0 to 23
Assert.isTrue(0 <= month && month <= 11, "month param must be a value from 0 (January) to 11 (December)");
126
153
Assert.isTrue(1 <= day && day <= 31, "day param must be a value from 1 to 31");
127
154
Assert.isTrue(0 <= hour && hour <= 23, "hour param must be a value from 0 to 23");
@@ -138,14 +165,14 @@ public static Date of(int year, int month, int day, int hour){
138
165
* Creates an UTC-based {@Link Date} from the provided {@code year}, {@code month}, {@code day}, {@code hour} and {@code minute}.
139
166
* Uses the current date and time, sets the specified {@code year}, {@code month}, {@code day}, {@code hour} and {@code minute}, and returns the Date converted to a UTC timestamp.
140
167
*
141
-
* @param year the year to represent
168
+
* @param year the year to represent
142
169
* @param month the month-of-year to represent, from 0 (January) to 11 (December)
143
-
* @param day the day-of-month to represent, from 1 to 31
144
-
* @param hour the hour-of-day to represent, from 0 to 23
145
-
* @param minute the minute-of-hour to represent, from 0 to 59
170
+
* @param day the day-of-month to represent, from 1 to 31
171
+
* @param hour the hour-of-day to represent, from 0 to 23
172
+
* @param minute the minute-of-hour to represent, from 0 to 59
Assert.isTrue(0 <= month && month <= 11, "month param must be a value from 0 (January) to 11 (December)");
150
177
Assert.isTrue(1 <= day && day <= 31, "day param must be a value from 1 to 31");
151
178
Assert.isTrue(0 <= hour && hour <= 23, "hour param must be a value from 0 to 23");
@@ -164,15 +191,15 @@ public static Date of(int year, int month, int day, int hour, int minute){
164
191
* Creates an UTC-based {@Link Date} from the provided {@code year}, {@code month}, {@code day}, {@code hour}, {@code minute} and {@code second}.
165
192
* Uses the current date and time, sets the specified {@code year}, {@code month}, {@code day}, {@code hour}, {@code minute} and {@code second}, and returns the Date converted to a UTC timestamp.
166
193
*
167
-
* @param year the year to represent
194
+
* @param year the year to represent
168
195
* @param month the month-of-year to represent, from 0 (January) to 11 (December)
169
-
* @param day the day-of-month to represent, from 1 to 31
170
-
* @param hour the hour-of-day to represent, from 0 to 23
171
-
* @param minute the minute-of-hour to represent, from 0 to 59
172
-
* @param second the second-of-hour to represent, from 0 to 59
196
+
* @param day the day-of-month to represent, from 1 to 31
197
+
* @param hour the hour-of-day to represent, from 0 to 23
198
+
* @param minute the minute-of-hour to represent, from 0 to 59
199
+
* @param second the second-of-hour to represent, from 0 to 59
Assert.isTrue(0 <= month && month <= 11, "month param must be a value from 0 (January) to 11 (December)");
177
204
Assert.isTrue(1 <= day && day <= 31, "day param must be a value from 1 to 31");
178
205
Assert.isTrue(0 <= hour && hour <= 23, "hour param must be a value from 1 to 23");
@@ -193,16 +220,16 @@ public static Date of(int year, int month, int day, int hour, int minute, int se
193
220
* Creates an UTC-based {@Link Date} from the provided {@code year}, {@code month}, {@code day}, {@code hour}, {@code minute} and {@code second}.
194
221
* Uses the current date and time, sets the specified {@code year}, {@code month}, {@code day}, {@code hour}, {@code minute} and {@code second}, and returns the Date converted to a UTC timestamp.
195
222
*
196
-
* @param year the YEAR to represent
197
-
* @param month the MONTH to represent, from 0 (January) to 11 (December)
198
-
* @param day the DAY_OF_MONTH to represent, from 1 to 31
199
-
* @param hour the HOUR_OF_DAY to represent, from 0 to 23
200
-
* @param minute the MINUTE to represent, from 0 to 59
201
-
* @param second the SECOND to represent, from 0 to 59
223
+
* @param year the YEAR to represent
224
+
* @param month the MONTH to represent, from 0 (January) to 11 (December)
225
+
* @param day the DAY_OF_MONTH to represent, from 1 to 31
226
+
* @param hour the HOUR_OF_DAY to represent, from 0 to 23
227
+
* @param minute the MINUTE to represent, from 0 to 59
228
+
* @param second the SECOND to represent, from 0 to 59
202
229
* @param millisecond the MILLISECOND to represent, from 0 to 59
0 commit comments