6 replies
by simonnd Accepted solution
by older mycroft Accepted solution
The ordinal date is the year number combined with the ordinal day of the year, i.e. the number of days from the beginning of the current year. This is often called the "Julian date," especially in the military, although it is based upon the Gregorian, not the Julian, calendar. The day of the year is numbered 001-365 (366 in leap years). (By definition, ordinal numbers start with 1, while cardinal numbers start with 0; sometimes day 0, or January 0, of a particular year is referred to, which is the same as December 31 of the previous year.)
According to ISO 8601:2004, the year must be written in full, i.e. YYYYDDD or YYYY-DDD, although previous editions of ISO 8601 permitted a truncated format with just the last two digits, i.e. YYDDD or YY-DDD, or no year, i.e. -DDD. As examples of the current standard, December 31, 1999, may be represented as 1999365 or 1999-365, and January 1, 2000, as 2000-001 or 2000001. The ISO standard permits only standard time representation, prefixed by the letter T, such as 2000-001T12:00:00.
Julian date format only contains DAYS.
The Julian date for:
2008 November 26 10:06:00.0 UT is
JD 2454796.92083
by john.a.wills Accepted solution
by older mycroft Accepted solution
by tony hopkinson Accepted solution
and cursed the eejit who came up with such non-standard rubbish
I assume that 2008001 is coming in a as number?
and that it's day 1 of 2008.
select DateAdd(day,
Convert(Int,
Substring(
Convert(VarChar(7),CrapDate),5,3))),
Convert(DateTime,
Convert(VarChar(4),CrapDate) + '01-01')
From ImportwithCrapDates
I may have missed a parentheses out of that,but basically
It's start of year + (daynumber - 1)
by john.a.wills Accepted solution
This discussion is closed to new replies.
Trending Software posts
Sort by Trending