“时间格式的处理”的版本间差异

来自Shiyin's note
跳到导航 跳到搜索
(以“* 读入 year =0 & month = 0 & day = 0 ;初始化定义 Date='2012-02-21' reads,Date,year,month,day,format='(I4,1x,I2,1x,I2)' * 转换成儒略日 TIMEGEN,JULD...”为内容创建页面)
 
无编辑摘要
第4行: 第4行:
reads,Date,year,month,day,format='(I4,1x,I2,1x,I2)'
reads,Date,year,month,day,format='(I4,1x,I2,1x,I2)'


* 转换成儒略日
*儒略日计算
Jul=Julday(month,day,year,hour,minute,second)
TIMEGEN,JULDAY

*由儒略日计算date
CALDAT, Jul, Month [, Day [, Year [, Hour [, Minute [, Second]]]]]

*生成儒略日时间
MyTimes = TIMEGEN(365, UNITS="Days") + SYSTIME(/JULIAN)
MyTimes = TIMEGEN(12, UNITS="Months", START=JULDAY(1,1,2000))



* 画图,时间坐标
* 画图,时间坐标

2014年11月5日 (三) 01:31的版本

  • 读入
year =0  & month = 0 & day = 0 ;初始化定义
Date='2012-02-21'
reads,Date,year,month,day,format='(I4,1x,I2,1x,I2)'
  • 儒略日计算
Jul=Julday(month,day,year,hour,minute,second)
  • 由儒略日计算date
CALDAT, Jul, Month [, Day [, Year [, Hour [, Minute [, Second]]]]]
  • 生成儒略日时间
MyTimes = TIMEGEN(365, UNITS="Days") + SYSTIME(/JULIAN)
MyTimes = TIMEGEN(12, UNITS="Months", START=JULDAY(1,1,2000))


  • 画图,时间坐标
label_date
例:  dummy = LABEL_DATE(DATE_FORMAT='%M%Z')
mytimes=timegen(12,unit='months,start=julday(1,1,2012))
y=findgen(12)
plot,mytimes,y,xtickformat='label_date'
DATE_FORMAT 格式
%M for month
%N for month (2 digit abbr)
%D for day of month,
%Y for 4 digit year.
%Z for last two digits of year.
%W for day of week
   For time:
%A for AM or PM
%H for Hours, 2 digits.
%I for minutes, 2 digits.
%S for Seconds, 2 digits.
%0--%9 following %S, indicates digits after decimal point.
%% is %
例子  '%D/%N/%Y' yields 11/12/1993
'%M!C%Y' yields DEC on the top line, 1993 on  the bottom (!C is the new line graphic command).