List of usage examples for org.joda.time Chronology millisOfDay
public abstract DateTimeField millisOfDay();
From source file:ch.oakmountain.tpa.solver.PeriodicalTimeFrame.java
License:Apache License
/** * Gets the field for a specific index in the chronology specified. * <p/>//from w ww . j av a 2 s. c o m * This method must not use any instance variables. * * @param index the index to retrieve * @param chrono the chronology to use * @return the field */ protected DateTimeField getField(int index, Chronology chrono) { switch (index) { case DAY_OF_WEEK: return chrono.dayOfWeek(); case MILLIS_OF_DAY: return chrono.millisOfDay(); default: throw new IndexOutOfBoundsException("Invalid index: " + index); } }
From source file:org.jruby.ext.date.RubyDateTime.java
License:LGPL
static DateTime withTimeAt0InZone(DateTime dt, DateTimeZone zone) { long millis = dt.getZone().getMillisKeepLocal(zone, dt.getMillis()); final Chronology chronology = dt.getChronology().withZone(zone); millis = chronology.millisOfDay().set(millis, 0); return new DateTime(millis, chronology); }