Skip to content
Snippets Groups Projects
Commit f444b154 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

DOC: add helpful comments

parent 6c9819c2
Branches
Tags
1 merge request!69BUG: setup timezone in deploy
Pipeline #29025 failed
......@@ -127,15 +127,17 @@ public class UTCTimeZoneShift extends TimeZone {
}
/**
* Generate an ISO 8601 time zone offset string (e.g. +0200) from the given raw offset in
* milliseconds.
* Generate an ISO 8601 time zone offset string
* (e.g. +0200) for the current time
*
* @param timezone - the time zone in question.
* @return ISO 8601 time zone offset.
*/
public static String getISO8601Offset(TimeZone timezone) {
int divisor = 1000 * 60 * 60;
// get the offset of the given timezone to UTC at the current time
int offset = timezone.getOffset(System.currentTimeMillis());
// convert the ms to the ISO format
int sign = Integer.signum(offset);
int h = Integer.divideUnsigned(sign * offset, divisor);
int m = Integer.remainderUnsigned(sign * offset, divisor);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment