I am constructing a date-time variable in 2 steps, using variables for year, month, day, hour, minutes, seconds. My code is:

Code:
gen enroute_date = mdy(enroute_month,enroute_day,enroute_year)
    format enroute_date %td
gen enroute_time = dhms(enroute_date,enroute_hour,enroute_min,enroute_sec)
    format enroute_time %tc
The variable enroute_date comes out correct every time, but the variable enroute_time is coming out with incorrect minute and seconds. The error --- the difference between enroute_hour:enroute_min:enroute_sec and the time shown in enroute_time --- is sometimes positive (later than given) and sometimes negative (earlier), and usually but not always under 60 seconds. I am not sure if the problem is with my use of dhms() or my use of format %tc. You can see the errors in the attached pic below. How can I address this? Thanks!

Array