Syntax to convert a numeric Julian Date to a new variable format of ADATE.

Technote (FAQ)


Question

How to take a 5 or a 7 digit numeric Julian Date and convert to a new 10 DATE format of ADATE.

Cause

How to question.

Answer

[ASSUMPTIONS]
Julian Date is a 5 digit numeric variable.

Using your data you would just change the name of 'newdate' and 'jdvar'
in the syntax below for the COMPUTE and FORMATS statements to match your variable names.

COMPUTE newdate=date.yrday (number(substr(string(jdvar,n7),1,4),f4),

number(substr(string(jdvar,n7),5,3),f3)).
EXECUTE.

FORMATS newdate (adate10).
-------------------------------------------------------------

[ASSUMPTIONS]
Julian Date is a 7 digit numeric variable.

Using your data you would just change the name of 'newdate' and 'jdvar'
in the syntax below for the COMPUTE and FORMATS statements to match your variable names.

COMPUTE newdate=date.yrday (number(substr(string(jdvar,f7),1,4),f4),
number(substr(string(jdvar,f7),5,3),f3)).
EXECUTE.

FORMATS newdate (adate10).


Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

SPSS Statistics

Software version:

Not Applicable

Operating system(s):

Platform Independent

Reference #:

1654997

Modified date:

2013-11-01

Translate my page

Machine Translation

Content navigation