Discussion:
Conversion to Julian date
(too old to reply)
Joe Matise
2008-09-26 04:50:52 UTC
Permalink
You want to format it (make it visually appear as a julian date) or want a
string value for the julian date?

If you mean the former, then just use the format JULIANw., so:

dateval = datepart(datetimeval);
format dateval JULIAN7.;

will take that variable in your OP (01JUN08) and convert it to 2008153 (or
whatever 01 June is in Julian), visually. It still has the 'value' behind
it of a SAS Date value, though, so if you proc export to excel or whatnot it
might or might not maintain that format (no idea).

If you need it to become a string, then you can use put:

format dateval $7.;
dateval = put(datepart(datetimeval)),JULIAN7.);

(untested) and that should put that value in a string format. Of course you
lose the ability to play with the numeric value easily at that point, but
it's the alternative.

-Joe
I want to convert the variable date (format datetime. ) to a Julian date.
Can some some help me with the code.
date Julian_date
01JUN08:10:57:23 ?
Thank you
Randy
Alan Churchill
2008-09-26 04:45:02 UTC
Permalink
Use the JULIAN format. It's in the docs.

Alan

Alan Churchill
Savian
www.savian.net

-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-***@LISTSERV.UGA.EDU] On Behalf Of Randy
Sent: Thursday, September 25, 2008 10:38 PM
To: SAS-***@LISTSERV.UGA.EDU
Subject: Conversion to Julian date

Dear All:
I want to convert the variable date (format datetime. ) to a Julian date.
Can some some help me with the code.

date Julian_date
01JUN08:10:57:23 ?

Thank you
Randy
Jack Hamilton
2008-09-26 16:11:18 UTC
Permalink
Which kind of Julian date? The one whose value today is 2008.270 (or
2008270), or the one whose value today is 2,454,466?

--
Jack Hamilton
***@alumni.stanford.org
Videtis illam spirare libertatis auram
I want to convert the variable date (format datetime. ) to a Julian
date.
Can some some help me with the code.
date Julian_date
01JUN08:10:57:23 ?
Thank you
Randy
Randy
2008-09-28 00:55:49 UTC
Permalink
The one whose value is 2008270.

Thanks
Alysson Jalles
2015-03-30 00:50:03 UTC
Permalink
Hello, how can I convert Julia formats to normal dates a times?
My values are like this:

data want;
input var1_jul;
cards;
41719.58385
41719.62234
41719.62616
41719.63021
41719.6331
;

I know 41719.58385 is: 21/03/2014 and 14:00:45
But how can I perform this conversion in SAS?
Barry Schwarz
2015-03-30 05:15:56 UTC
Permalink
On Sun, 29 Mar 2015 17:50:03 -0700 (PDT), Alysson Jalles
Post by Alysson Jalles
Hello, how can I convert Julia formats to normal dates a times?
data want;
input var1_jul;
cards;
41719.58385
41719.62234
41719.62616
41719.63021
41719.6331
;
I know 41719.58385 is: 21/03/2014 and 14:00:45
But how can I perform this conversion in SAS?
Google and Wikipedia can be your friends.
--
Remove del for email
s***@gmail.com
2020-05-30 02:41:30 UTC
Permalink
Julian Date is most commonly referred to as yyddd date format (yy=year and ddd=day). This format is mostly used in Mainframe world and is called as Ordinal date.

You can check this website to convert date to Julian date - https://www.juliandate.net

Astronomers refer to a Julian date as the number of days since the beginning of the Julian Period (January 1, 4713 BC). The Smithsonian Astrophysical Observatory introduced the 'Modified Julian Date' to record the orbit of the Sputnik satellite in 18 bits
Loading...