Architecting, installing and maintaining your SAS environment

Convert Timestamp to date9.

Accepted Solution Solved
Reply
Contributor
Posts: 51
Accepted Solution

Convert Timestamp to date9.

Hello guys,

i do convert this time stamp:

23DEC2004:20:02:53.000000 (char25)

in

23DEC2004  (date9.)

Please, help.

Thank's


Accepted Solutions
Solution
‎08-24-2012 06:51 AM
Super Contributor
Posts: 349

Re: Convert Timestamp to date9.

Hi,

Try this..

data test;

input time $ 25.;

date=input(time,date9.);

format date date9.;

cards;

23DEC2004:20:02:53.000000

;

run;

Thanks,

Shiva

View solution in original post


All Replies
Solution
‎08-24-2012 06:51 AM
Super Contributor
Posts: 349

Re: Convert Timestamp to date9.

Hi,

Try this..

data test;

input time $ 25.;

date=input(time,date9.);

format date date9.;

cards;

23DEC2004:20:02:53.000000

;

run;

Thanks,

Shiva

Contributor
Posts: 51

Re: Convert Timestamp to date9.

Smiley Wink

Thank's

Contributor
Posts: 28

Re: Convert Timestamp to date9.

the datepart function converts an integer datetime to an integer date value.

the example here converts text datetime to integer date.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 10139 views
  • 1 like
  • 3 in conversation