BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
frakje
Calcite | Level 5

Hallo

 

I'm dealing with a problem I hope you guys can help me with.

I have a date var which is located as a character variable.

 

Date = '2010-07-12 12:20:51'

I want to convert it into a sas date with time registrated. Probably on the format datetime16.

 

How can I do that?

 

Thanks for the help.

 

Kind regard Frank.

1 ACCEPTED SOLUTION

Accepted Solutions
3 REPLIES 3
Kurt_Bremser
Super User
numdate = input(chardate,e8601dt19.);
format numdate e8601dt19.;

The e8601dt informat will do the conversion. Personally, I prefer formats with a ymdhms order.

frakje
Calcite | Level 5

Thank you KurtBremser it worked fine!

Reeza
Super User
Please mark the question as answered - Kurt's solution.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 770 views
  • 0 likes
  • 3 in conversation