以前没有接触过IDL的时间,查了半天原来是儒略日,老是计算不对,
比如,2000年1月1日12:00:00后 100万秒是几点几分?
查了半天,原来有这么一个用法
julday(时间) + 天数 = 新天数。
这个天数可以是小数点,比如365.5天就是365天+60*60*12秒,这样就简单多了。
getDays = totalseconds/ ( 60.0 * 60.0 * 24.0 );
(如果用60*60*24则计算错误)
;caldat只用于天数相加.可以为小数
caldat,julday(1,1,2000,12,0,0) + getDays, month, day, year, hour,minute,second
theDate = strcompress(strtrim(year) + '/'+strtrim(month)+'/'+strtrim(day),/REMOVE_ALL )
theTime = strcompress(strtrim(hour)+':'+strtrim(minute)+':'+strtrim(second),/REMOVE_ALL )
theDateTime = strcompress(theDate + ' ' + theTime)
print, theDateTime