BookmarkSubscribeRSS Feed
floflow
Calcite | Level 5

Hi,

 

I want to transform my hours that are currently in 12hour clock, with am pm to 24 hours clock

 

Thanks for your help! 

1 REPLY 1
PaigeMiller
Diamond | Level 26

First, you need to let us know if these are numeric variables (according to PROC CONTENTS) or character variables.

 

If numeric, probably the format TIMEAMPM. is assigned to this variable. All you need to do is assign the TIME. format to this variable.

 

In a data step, or PROC, use

 

format yourvariablename time.;
--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 954 views
  • 3 likes
  • 2 in conversation