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

[IDV #OBO-782063]: IDV - time label for long past



Hi Stu-

> Institution: UNAVCO
> Package Version: 1.3b1

You should probably move to 1.3b2 sooner rather than later.
We're already working on the next release.

> Operating System: linux
> Hardware Information: usual
> Inquiry: I have earth mantle structure data, dated in millions of years 
> before present.  If the NetCDF file has time value -170.47 and the time
> units are Myear, then the label on the IDV time control is
> 170466519-01-03 14:39:46Z BCE.
> 
> This is probably correct but a calendar date, correct to the second, is not 
> what the user wants.
> 
> Is the code for this available?  I might extend or modify it for the GEON IDV 
> so that times more than say 5,000 years ago are labeled just "170 mybp"

Dates are formated through the VisAD DateTime class.  For the IDV,
there is a default format:

    /** default date format */
    public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss z";

in IdvConstants.  There is no UI for the user to change the format.
If you bring up the User Preferences, you can change the timezone.
It would be pretty easy to add in an widget to change the format
as well.  You'd just have to edit IdvPreferenceManager.

Using the VisAD DateTime class, you can set a static formatting for
the run of the application.  However, in looking at the formatting docs,
I don't see that there's a way to format a Java date the way you
want.

Don Murray

Ticket Details
===================
Ticket ID: OBO-782063
Department: Support IDV
Priority: Normal
Status: Open