Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

convertir fecha juliana a gregoriana

1,340 views
Skip to first unread message

Hector Carvajal

unread,
Apr 11, 2003, 5:33:56 PM4/11/03
to
Saludos.

Necesito saber como transformo de fecha juliana a gregoriana en SQLServer.


Eladio Rincón

unread,
Apr 13, 2003, 3:38:28 PM4/13/03
to
Hola,

tenía guardado este codigo de BPMargolin:

---
Julian date is actually a somewhat ill-defined term. Different people mean
it to mean different things. I'll assume you mean by a Julian date, a date
something like: 1999321 where the first 4 digits are the year, and the last
3 digits are the sequential day in the year. If so, then:

declare @Julian int, @Year int, @DayInYear int, @Gregorian datetime
select @Julian = 1999321

select @Year = @Julian / 1000
select @DayInYear = @Julian - 1000 * @Year

select @Gregorian = convert(datetime, 'Jan 1 ' + str(@Year))
select @Gregorian = DateAdd (d, @DayInYear, @Gregorian)

select Gregorian = @Gregorian
---

En siquelnet
(http://eu.webmatrixhosting.net/Eladio/default.aspx?Tema=MSSQL&Seccion=ARQ&A
rticulo=004.xml) tiene un enlace a una url que seguro que te es de utilidad
: ""The Julian and Gregorian Calendars" by Peter Meyer"

--
Saludos,

Eladio Rincón
MCP SQL Server
http://eu.webmatrixhosting.net/Eladio

"Comparte lo que sabes, aprende lo que no sepas". FGG

"Hector Carvajal" <hcar...@sonitel.com> escribió en el mensaje
news:#u4OBIHA...@TK2MSFTNGP12.phx.gbl...

0 new messages