Java Parse Time parseTimezoneOffset(String value)

Here you can find the source of parseTimezoneOffset(String value)

Description

parse Timezone Offset

License

Open Source License

Declaration

private static long parseTimezoneOffset(String value) throws ParseException 

Method Source Code


//package com.java2s;

import java.text.ParseException;

public class Main {
    private static long parseTimezoneOffset(String value) throws ParseException {
        int pos = value.indexOf(':');
        if (pos == -1) {
            throw new ParseException("Invalid offset value: " + value, 0);
        }/*from w  w w  .  j  a  va  2  s.c om*/
        String hours = value.substring(0, pos);
        String minutes = value.substring(pos + 1);
        return (Long.parseLong(hours) * 60 + Long.parseLong(minutes)) * 60;
    }
}

Related

  1. parseTimeConfiguration(String time)
  2. parseTimeSpec(String[] spec)
  3. parseTimeStr(String timeStr)
  4. parseTimeString(String time)
  5. parseTimeString(String timeString)