Program JUL2GREG

Usage

    jul2greg <Julian date>
or, alternately,
    jul2greg [ yesterday | today | tomorrow ]
or
    jul2greg --help

Summary

Convert Julian-style date YYYYDDD or yesterday, today, or tomorrow command line argument to Gregorian style date YYYYMMDD and echo the result to standard output as a single 8-digit integer formatted YYYYMMDD.

If --help is the argument, writes the USAGE screen and exits.

Not case sensitive.

Examples

Some sample executions of this program are as indicated below (where, for purposes of illustration, "today", as I write, is January 29, 2014).

(Note that in shell-scripting, the back-quote character means "the result of evaluating the enclosed command" so that the fourth example below sets shell variable foo to the result of executing the indicated jul2greg command.)

     % jul2greg 2014029
     20140129

     % jul2greg YESTERDAY
     20140128

     % jul2greg tomorrow
     20140130

     % set foo = `jul2greg 1997123`
     % echo ${foo}
     19970503

     % jul2greg --help
         %  jul2greg <Julian date>
         or
         %  set gdate = `jul2greg <calendar date>

         Options for Julian date:
              <YYYYDDD>,  e.g., 2010123
              TODAY
              YESTERDAY
              TOMORROW
              --HELP

         Output format is 8-digit integer YYYYMMDD

See Also

EDSS/ Models-3 date-time manipulation routines
datshift
gregdate
greg2jul
juldate
jul2greg
juldiff
julshift
timeshift

Previous: greg2jul

Next: juldiff

Up: Related Programs

To: Models-3/EDSS I/O API: The Help Pages