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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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