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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 547 views
  • 0 likes
  • 3 in conversation