## Simple Date Informat Question

Solved
Occasional Contributor
Posts: 9

# Simple Date Informat Question

i have data in is8601 dt format.

eg:-'2016-09-15T12:40:23'.

i want to calculate number of days from 1960-01-01.

how do i get that

Accepted Solutions
Solution
‎06-29-2016 08:05 AM
Posts: 1,147

## Re: Simple Date Informat Question

``````data have;
date1='2016-09-15T12:40:23';
date2='1960-01-01';
run;

data want;
set have;
days=intck('day',input(date2,yymmdd10.),datepart(input(date1,is8601dt.)));
run;
``````
Thanks,
Jag

All Replies
Solution
‎06-29-2016 08:05 AM
Posts: 1,147

## Re: Simple Date Informat Question

``````data have;
date1='2016-09-15T12:40:23';
date2='1960-01-01';
run;

data want;
set have;
days=intck('day',input(date2,yymmdd10.),datepart(input(date1,is8601dt.)));
run;
``````
Thanks,
Jag
Occasional Contributor
Posts: 9

## Re: Simple Date Informat Question

Occasional Contributor
Posts: 9

## Re: Simple Date Informat Question

wouold it work if there wasnt a T in Date1?

Posts: 1,147