[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
20021231: radiosonde display of current and previous day
- Subject: 20021231: radiosonde display of current and previous day
- Date: Tue, 31 Dec 2002 11:51:39 -0700
>From: Sridharareddy Duggireddy <address@hidden>
>Organization: USF
>Keywords: 200212311713.gBVHDKt19823 McIDAS UAPLOT
Shridhara,
> I am trying to display the radiosonde display. I have to display the
>current and previous day's skew-T observations using UAPLOT. In that
>command I have to enter previous day's date in order to display previous
>day's image. can you please tell me how to display the previous day's date
>in linux?
The GNU version of 'date' on Linux allows you to list out the date value
contained in a STRING. Here is the top part of the man page for date:
% man date
DATE(1) FSF DATE(1)
NAME
date - print or set the system date and time
SYNOPSIS
date [OPTION]... [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
DESCRIPTION
Display the current time in the given FORMAT, or set the
system date.
-d, --date=STRING
display time described by STRING, not `now'
...
This allows you to list the date for 'yesterday':
% date -d yesterday
Mon Dec 30 11:38:49 MST 2002
As you can see from the man page, 'date' allows you to format the
output in a variety of ways.
McIDAS understands a variety of formats for date and time. The McIDAS
command ARGHELP will list out those formats that are recognized.
Here are the acceptable formats for dates in McIDAS:
ARGHELP DATE
--------------------------------------------------------------------------------
Valid McIDAS date argument format:
[+-]yyyyddd , [+-]yyyy/mm/dd , [+-]mm/dd , [+-]dd/mon/yyyy , [+-]dd/mon ,
[+-]yyyy-mm-dd , [+-]mm-dd , [+-]dd-mon-yyyy , [+-]dd-mon
where: yyyy = year (def=current year & century)
mm = month (def=current month)
mon = calendar month (>=3 chars)
dd = day of month (required)
ddd = day of year (required)
'/' = today's date
Acceptable Forms: [+-]yyyy/mm/dd , [+-]mm/dd , [+-]/mm/dd , [+-]yyyyddd ,
[+-]dd/mon/yyyy , [+-]dd/mon , [+-]dd/mon/ , [+-]ddd ,
[+-]/ , [+-]/dd , [+-]dd/ , [+-]//dd , [+-]dd//
--------------------------------------------------------------------------------
So, you have your choice of how to format the output from 'date' into a
form that McIDAS will understand. For instance, if you wanted the date
to be represented by the century, year, and Julian day [YYYYDDD], you
would do the following:
% date -d yesterday +%Y%j
2002364
If you wanted the format YYYY/MM/DD, you would use:
% date -d yesterday +%Y/%m/%d
2002/12/30
etc.
The last thing you need to worry about is Universal Coordinated Time (UTC).
Since dates/times in McIDAS are always specified in UTC, you need to
tell 'date' to do its calculation using UTC. This is done by including
the '-u' flag:
date -u -d yesterday +%Y%j
date -u -d yesterday +%Y/%m/%d
and so on.
Check out the man page for date on your Linux system for more information.
Tom