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
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.