Are you getting it from outside SAS? If it's from outside SAS (Excel for example), the representation can be different and a conversion is necessary. Again using Excel as an example, Excel bases everything off of Jan 1, 1900. SAS, on the other hand, bases everything off of Jan 1, 1960. Excel date-times will appear to be far in the future in SAS if not converted.
Inside SAS, normally one just subtracts the ending date-time value from the starting date-time value. I typically use the format TIME13.2 with elapsed times.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.