[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFJava #TVQ-727289]: CalendarDate methods and ncIdv.jar



The first method was already there, the secnd ive just added. both have this 
caveat:

   * NOTE: we are using jodatime patterns right now, but may switch to jsr-310 
when thats available in java 8.
   *  Not sure whether these patterns will still work then, so use this 
formatter at the risk of having to
   *  change it eventually. OTOH, its likely that the same functionality will 
be present in jsr-310.
 

 public CalendarDateFormatter(String pattern) {
    dflocal = DateTimeFormat.forPattern(pattern).withZoneUTC();
  }

  public CalendarDateFormatter(String pattern, CalendarTimeZone tz) {
    dflocal = DateTimeFormat.forPattern(pattern).withZone( 
tz.getJodaTimeZone());
  }

> >
> > Also, for formatting on output, the IDV supports specifying the
> > TimeZone.  It would be useful to have a method in CalendarDateFormatter
> > which would take a custom format string and a timezone, something like:
> >
> > public static String formattedString(CalendarDate cd, String pattern,
> > CalendarTimeZone tz) {
> > DateTimeFormatter mydf =
> > DateTimeFormat.forPattern(pattern).withZone(CalendarTimeZone.getDateTimeZone());
> > return mydf.print(cd.getDateTime());
> >
> > }


Ticket Details
===================
Ticket ID: TVQ-727289
Department: Support netCDF Java
Priority: Normal
Status: Open