1/*2* Copyright 2001-2005 Stephen Colebourne3*4* Licensed under the Apache License, Version 2.0 (the "License");5* you may not use this file except in compliance with the License.6* You may obtain a copy of the License at7*8* http://www.apache.org/licenses/LICENSE-2.09*10* Unless required by applicable law or agreed to in writing, software11* distributed under the License is distributed on an "AS IS" BASIS,12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13* See the License for the specific language governing permissions and14* limitations under the License.15*/16packageorg.joda.time; 17 18/**19* DateTimeConstants is a non-instantiable class of constants used in20* the date time system. These are the ISO8601 constants, but should be21* used by all chronologies.22* <p>23* DateTimeConstants is thread-safe and immutable.24*25* @author Stephen Colebourne26* @author Brian S O'Neill27* @since 1.028*/29publicclassDateTimeConstants { 30 31// These are ints not enumerations as they represent genuine int values32/**Constant (1) representing January, the first month (ISO) */33publicstaticfinalintJANUARY = 1; 34 35/**Constant (2) representing February, the second month (ISO) */36publicstaticfinalintFEBRUARY = 2; 37 38/**Constant (3) representing March, the third month (ISO) */39publicstaticfinalintMARCH = 3; 40 41/**Constant (4) representing April, the fourth month (ISO) */42publicstaticfinalintAPRIL = 4; 43 44/**Constant (5) representing May, the fifth month (ISO) */45publicstaticfinalintMAY = 5; 46 47/**Constant (6) representing June, the sixth month (ISO) */48publicstaticfinalintJUNE = 6; 49 50/**Constant (7) representing July, the seventh month (ISO) */51publicstaticfinalintJULY = 7; 52 53/**Constant (8) representing August, the eighth month (ISO) */54publicstaticfinalintAUGUST = 8; 55 56/**Constant (9) representing September, the nineth month (ISO) */57publicstaticfinalintSEPTEMBER = 9; 58 59/**Constant (10) representing October, the tenth month (ISO) */60publicstaticfinalintOCTOBER = 10; 61 62/**Constant (11) representing November, the eleventh month (ISO) */63publicstaticfinalintNOVEMBER = 11; 64 65/**Constant (12) representing December, the twelfth month (ISO) */66publicstaticfinalintDECEMBER = 12; 67 68// These are ints not enumerations as they represent genuine int values69/**Constant (1) representing Monday, the first day of the week (ISO) */70publicstaticfinalintMONDAY = 1; 71 72/**Constant (2) representing Tuesday, the second day of the week (ISO) */73publicstaticfinalintTUESDAY = 2; 74 75/**Constant (3) representing Wednesday, the third day of the week (ISO) */76publicstaticfinalintWEDNESDAY = 3; 77 78/**Constant (4) representing Thursday, the fourth day of the week (ISO) */79publicstaticfinalintTHURSDAY = 4; 80 81/**Constant (5) representing Friday, the fifth day of the week (ISO) */82publicstaticfinalintFRIDAY = 5; 83 84/**Constant (6) representing Saturday, the sixth day of the week (ISO) */85publicstaticfinalintSATURDAY = 6; 86 87/**Constant (7) representing Sunday, the seventh day of the week (ISO) */88publicstaticfinalintSUNDAY = 7; 89 90 91/**Constant (0) representing AM, the morning (from Calendar) */92publicstaticfinalintAM = 0; 93 94/**Constant (1) representing PM, the afternoon (from Calendar) */95publicstaticfinalintPM = 1; 96 97 98/**Constant (0) representing BC, years before zero (from Calendar) */99publicstaticfinalintBC = 0; 100/**Alternative constant (0) representing BCE, Before Common Era (secular) */101publicstaticfinalintBCE = 0; 102 103/**104* Constant (1) representing AD, years after zero (from Calendar).105* <p>106* All new chronologies with differrent Era values should try to assign107* eras as follows. The era that was in force at 1970-01-01 (ISO) is assigned108* the value 1. Earlier eras are assigned sequentially smaller numbers.109* Later eras are assigned sequentially greater numbers.110*/111publicstaticfinalintAD = 1; 112/**113* Alternative constant (1) representing CE, Common Era (secular).114* <p>115* All new chronologies with differrent Era values should try to assign116* eras as follows. The era that was in force at 1970-01-01 (ISO) is assigned117* the value 1. Earlier eras are assigned sequentially smaller numbers.118* Later eras are assigned sequentially greater numbers.119*/120publicstaticfinalintCE = 1; 121 122 123/**Milliseconds in one second (1000) (ISO) */124publicstaticfinalintMILLIS_PER_SECOND = 1000; 125 126/**Seconds in one minute (60) (ISO) */127publicstaticfinalintSECONDS_PER_MINUTE = 60; 128/**Milliseconds in one minute (ISO) */129publicstaticfinalintMILLIS_PER_MINUTE = MILLIS_PER_SECOND * SECONDS_PER_MINUTE; 130 131/**Minutes in one hour (ISO) */132publicstaticfinalintMINUTES_PER_HOUR = 60; 133/**Seconds in one hour (ISO) */134publicstaticfinalintSECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR; 135/**Milliseconds in one hour (ISO) */136publicstaticfinalintMILLIS_PER_HOUR = MILLIS_PER_MINUTE * MINUTES_PER_HOUR; 137 138/**Hours in a typical day (24) (ISO). Due to time zone offset changes, the139* number of hours per day can vary. */140publicstaticfinalintHOURS_PER_DAY = 24; 141/**Minutes in a typical day (ISO). Due to time zone offset changes, the number142* of minutes per day can vary. */143publicstaticfinalintMINUTES_PER_DAY = MINUTES_PER_HOUR * HOURS_PER_DAY; 144/**Seconds in a typical day (ISO). Due to time zone offset changes, the number145* of seconds per day can vary. */146publicstaticfinalintSECONDS_PER_DAY = SECONDS_PER_HOUR * HOURS_PER_DAY; 147/**Milliseconds in a typical day (ISO). Due to time zone offset changes, the148* number of milliseconds per day can vary. */149publicstaticfinalintMILLIS_PER_DAY = MILLIS_PER_HOUR * HOURS_PER_DAY; 150 151/**Days in one week (7) (ISO) */152publicstaticfinalintDAYS_PER_WEEK = 7; 153/**Hours in a typical week. Due to time zone offset changes, the number of154* hours per week can vary. */155publicstaticfinalintHOURS_PER_WEEK = HOURS_PER_DAY * DAYS_PER_WEEK; 156/**Minutes in a typical week (ISO). Due to time zone offset changes, the number157* of minutes per week can vary. */158publicstaticfinalintMINUTES_PER_WEEK = MINUTES_PER_DAY * DAYS_PER_WEEK; 159/**Seconds in a typical week (ISO). Due to time zone offset changes, the number160* of seconds per week can vary. */161publicstaticfinalintSECONDS_PER_WEEK = SECONDS_PER_DAY * DAYS_PER_WEEK; 162/**Milliseconds in a typical week (ISO). Due to time zone offset changes, the163* number of milliseconds per week can vary. */164publicstaticfinalintMILLIS_PER_WEEK = MILLIS_PER_DAY * DAYS_PER_WEEK; 165 166/**167* Restrictive constructor168*/169protectedDateTimeConstants() { 170 } 171 172 }