List of usage examples for java.time Month getValue
public int getValue()
From source file:Main.java
public static void main(String[] args) { Month m = Month.NOVEMBER; System.out.println(m.getValue()); System.out.println(m.name()); System.out.println(m.ordinal()); }
From source file:Main.java
public static void main(String[] args) { Month m = Month.FEBRUARY; System.out.println(m.getValue()); System.out.println(m.name()); System.out.println(m.ordinal()); }
From source file:Main.java
public static void main(String[] args) { Month m = Month.SEPTEMBER; System.out.println(m.getValue()); System.out.println(m.name()); System.out.println(m.ordinal()); }
From source file:Main.java
public static void main(String[] args) { Month m = Month.valueOf("MAY"); System.out.println(m.getValue()); System.out.println(m.name()); System.out.println(m.ordinal()); }
From source file:Main.java
public static void main(String[] args) { Month m = Month.from(LocalDate.now()); System.out.println(m.getValue()); System.out.println(m.name()); System.out.println(m.ordinal()); }
From source file:Main.java
public static void main(String[] args) { LocalDate date = LocalDate.of(2014, 2, 15); // 2014-02-15 Month february = date.getMonth(); System.out.println(february); // FEBRUARY int februaryIntValue = february.getValue(); System.out.println(februaryIntValue); // 2 // 28 , 29/*ww w .j a v a 2 s .c o m*/ System.out.println(String.format("%s , %s", february.minLength(), february.maxLength())); Month firstMonthOfQuarter = february.firstMonthOfQuarter(); System.out.println(firstMonthOfQuarter); // JANUARY }
From source file:Main.java
public static void main(String[] args) { LocalDate localDate = LocalDate.of(2014, Month.AUGUST, 3); System.out.println(localDate); Month month1 = Month.from(localDate); System.out.println(month1);//ww w . j a v a 2 s. c om Month month2 = Month.of(2); System.out.println(month2); Month month3 = month2.plus(2); System.out.println(month3); Month month4 = localDate.getMonth(); System.out.println(month4); int monthIntValue = month2.getValue(); System.out.println(monthIntValue); }
From source file:ch.algotrader.future.FutureSymbol.java
/** * Generates the RIC for the specified {@link ch.algotrader.entity.security.FutureFamily}. */// w w w . j av a 2 s .c om public static String getRic(SecurityFamily family, LocalDate expiration) { Month month = expiration.getMonth(); int year = expiration.getYear(); ; StringBuilder buffer = new StringBuilder(); buffer.append(family.getRicRoot() != null ? family.getRicRoot() : family.getSymbolRoot()); buffer.append(monthEnc[month.getValue() - 1]); buffer.append(String.valueOf(year).substring(3)); buffer.append(":VE"); return buffer.toString(); }
From source file:ch.algotrader.future.FutureSymbol.java
/** * Generates the ISIN for the specified {@link ch.algotrader.entity.security.FutureFamily}. *///from w w w.ja v a2 s . c o m public static String getIsin(SecurityFamily family, LocalDate expiration) { int week = 0; Month month = expiration.getMonth(); int year = expiration.getYear(); ; StringBuilder buffer = new StringBuilder(); buffer.append(week); buffer.append("F"); buffer.append(family.getIsinRoot() != null ? family.getIsinRoot() : family.getSymbolRoot()); buffer.append(monthEnc[month.getValue() - 1]); buffer.append(yearEnc[year % 10]); buffer.append("00000"); return buffer.toString(); }
From source file:de.jfachwert.rechnung.Rechnungsmonat.java
/** * Erzeugt einen gueltigen Rechnungsmonat. * * @param monat MOnat/*from www . j av a 2s. c om*/ * @param jahr vierstellige Zahl */ public Rechnungsmonat(Month monat, int jahr) { this(monat.getValue(), jahr); }