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

Hi All, 

 

I want to Convert the date/time from ISO8601 format to hour Format Please help on this. I have data like

 

name      Date1                           Date2

XYZ       2016-10-03T13:05         2016-09-26T12:35
ABC       2016-07-15T12:00         2016-10-18T11:30

BAC       2016-10-26T12:00         2016-08-10T10:45

CAB       2017-06-02                   2016-09-26T11:30

BDG      2016-06-23T14:00         2016-10-18T09:28
           
I require the output in two variables Hour1  and Hour2          

 

Thanks in advance

 

Regards

Daya 

             
            
            

 

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Have a look at the E8601DT informat, it will read char values as you show them below and convert it to a SAS Datetime value. You can use then the TIMEPART() function to only the time information.

View solution in original post

2 REPLIES 2
BrunoMueller
SAS Super FREQ

Have a look at the E8601DT informat, it will read char values as you show them below and convert it to a SAS Datetime value. You can use then the TIMEPART() function to only the time information.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 478 views
  • 1 like
  • 3 in conversation