Setting ADDPREC

The ADDPREC key affects not only the inclusion of the precision for convert_date. It also affects whether the current date and time are used to complete missing format elements.

To get the current date and time, ADDPREC must be set properly.

For DATECOPYOPT, the default is no precision, which affects the functioning of convert_date inside and outside of xlates. For example, TPS procs.

For example, in:

convert_date ch "" ts 12 

convert_date returns 2010, which is only the current year.

If you add the ADDPREC key, then:

convert_date -configure [list {ADDPREC 1}]

and then use:

convert_date ch "" ts 12

convert_date returns 201001051125, which is the full date and time.

You can also use:

convert_date -configure [list {ADDPREC 1}] ch "" ts 12

With ADDPREC enabled, if you use:

convert_date ch "" ts 19

convert_date returns 20100105112800-0600, the offset for Central time.