[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDFJava #TVQ-727289]: CalendarDate methods and ncIdv.jar
- Subject: [netCDFJava #TVQ-727289]: CalendarDate methods and ncIdv.jar
- Date: Sun, 28 Oct 2012 15:04:15 -0600
ok, thanks for the clarification;
im adding
/**
* Create CalendarDate from msecs since epoch
* Uses the given Calendar.
* @param cal calendar to use, or null for default
* @param msecs milliseconds from 1970-01-01T00:00:00Z
* @return CalendarDate in UTC time zone.
*/
public static CalendarDate of(Calendar cal, long msecs);
> Here's the code that works for me:
>
> public static CalendarDate of(long msecs) {
> return of(null, msecs);
> }
>
> /**
> * Create CalendarDate from msecs since epoch
> * @param msecs milliseconds from 1970-01-01T00:00:00Z
> * @return CalendarDate in UTC
> */
> public static CalendarDate of(Calendar cal, long msecs) {
> // Constructs an instance set to the milliseconds from
> 1970-01-01T00:00:00Z using ISOChronology in the specified time zone.
> if (cal == null) cal = Calendar.getDefault();
> Chronology chronology = Calendar.getChronology(cal);
> DateTime dt = new DateTime(msecs, chronology) ;
> return new CalendarDate(cal, dt);
> }
>
>
> On 10/27/12 2:28 PM, Unidata netCDF Java Support wrote:
> > Unless, the msecs are correctly calculated for that calendar. is that the
> > case?
> >
> >> Hi Don:
> >>
> >> The problem is that "msecs since <date>" already assumes a calendar. so it
> >> doesnt make sense to put it into a calendar AFAIU. Where do you get that
> >> msecs from ?
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: TVQ-727289
> > Department: Support netCDF Java
> > Priority: Normal
> > Status: Open
> >
>
> --
> Don Murray
> NOAA/ESRL/PSD and CIRES
> 303-497-3596
> http://www.esrl.noaa.gov/psd/people/don.murray/
>
>
Ticket Details
===================
Ticket ID: TVQ-727289
Department: Support netCDF Java
Priority: Normal
Status: Open