Solved
Contributor
Posts: 20

# Date/time calculations with Julian dates

I have a Julian date and time that I need to use as part of a computation(essentially I need to determine if that date/time is more than 30 minutes past the current date/time).

The date/time is in the format of YYYYDDD HHMM(e.g. - 2016287 1010)

I believe I need to use INTCK to perform this calculation, and my current Julian date won't work with that.

I can use DATEJUL to covert that Julian date to a sasdate, but I don't know how to incorporate the time into that as well.

Appreciate any assistance.

Accepted Solutions
Solution
‎10-13-2016 05:16 PM
Posts: 5,519

## Re: Date/time calculations with Julian dates

Use

time = input(timePart, hhmmss4.);

datetime = dhms(myDate, hour(time), minute(time), 0);

PG

All Replies
Super User
Posts: 13,498

## Re: Date/time calculations with Julian dates

Use the DHMS function with your date if you have a SAS time value to combine:

JulDateTime = DHMS(juldate,0,0,time);

Solution
‎10-13-2016 05:16 PM
Posts: 5,519

## Re: Date/time calculations with Julian dates

Use

time = input(timePart, hhmmss4.);

datetime = dhms(myDate, hour(time), minute(time), 0);

PG
☑ This topic is solved.