Here you can find the source of range(int unit)
static int range(int unit) throws Exception
//package com.java2s; /* Copyright (c) 2016// ww w.j a v a2 s .c om * by Bj?nd, Inc., Boston, MA * * This software is furnished under a license and may be used only in * accordance with the terms of such license. This software may not be * provided or otherwise made available to any other party. No title to * nor ownership of the software is hereby transferred. * * This software is the intellectual property of Bj?nd, Inc., * and is protected by the copyright laws of the United States of America. * All rights reserved internationally. * */ public class Main { public final static int SECONDS = 0; public final static int MINUTES = 1; public final static int HOURS = 2; public final static int DAYS = 3; public final static int MONTHS = 5; public final static int YEARS = 6; /** * Don't get excited. It's only an approximation */ static int range(int unit) throws Exception { switch (unit) { case YEARS: return Integer.MAX_VALUE; case MONTHS: return 12; // case WEEKS: // return 4; case DAYS: return 30; case HOURS: return 24; case MINUTES: return 60; case SECONDS: return 60; default: throw new Exception("Invalid unit: " + unit); } } }