Chris Beaumont's IDL Library

Download source code

single page | use frames     summary     class     fields     routine details     file attributes




result = time2string(time [, days=days])

This function converts a time length in seconds to a more readible string version of that number in years, days, minutes, and seconds

Return value

That time, converted to a more sensible string


time in required

A time length in seconds


days in optional

If set, time is interpreted to be a length in days, not seconds.


IDL> print, time2string(3605.5) 1 hour, 0 minutes and 5.5 seconds IDL> print, time2string(!dpi * 1D8) 9 years, 351 days, 2 hours, 27 minutes and 45.4 seconds IDL> print, time2string(1.5, /days) 1 day, 12 hours, 0 minutes and 0.0 seconds

Author information


April 5 2009: Written by Chris Beaumont April 7 2009: Added \days keyword

File attributes

Modifcation date: Mon Mar 22 16:17:13 2010
Lines: 77