BookmarkSubscribeRSS Feed
evp000
Quartz | Level 8

HI,

I was wondering what your suggestions would be in calculating the actual elapsed time between two timepoints when a time change occurs between them.  In the past I've done this manually:

- calculate the difference (in hours) using the start datetime and end datetime. 

-if the start point was prior to the time change and the end point was after the time change, add or subtract 1 hour (depending on whether it's spring or fall).

 

Would  INTCK('hour',startdatetime, enddatetime) somehow be able to take the time change into consideration?  I realize this is location-specific. 

 

Thanks for your input.

2 REPLIES 2
Shmuel
Garnet | Level 18

The arguments need for INTCK are not enough.

To calculate elapse hours is depnedet also on place, i.e. COUNTRY and sometime even REGION/STATE.

In some countries the change dates are dynamic according to political decisions, which make it even more complicate.

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
  • 1139 views
  • 0 likes
  • 2 in conversation