Re: Date in Julian Mode
Joel Schumacher <[email protected]>
| Newsgroups | gmane.comp.lang.4gl.fourjs.user |
|---|---|
| Message-ID | <[email protected]> |
What exactly do you mean by julian?
Some people call julian the number of days since a given date. Informix
database dates are defined as the number of days since Jan 1, 1900, where
Jan 1, 1900 is day 1.
If you pull a value from a database into a DATE variable, that internal
date variable is really using that counter. If you want to see that
integer, just do this:
DEFINE
da_misc DATE,
i_julian INTEGER
LET da_misc = "06/16/2005"
LET i_julian = da_misc
i_julian should be the number of days since Jan 1, 1900.
Some other people define julian as the number of days since the
beginning of the year. If 06/16/2005 is the 167th day of the year,
the julian value would be 167. In that case:
DEFINE
da_misc DATE,
i_julian INTEGER
LET da_misc = "06/16/2005"
LET i_julian = da_misc - MDY(1,1,YEAR(da_misc)) + 1
Some people also prefix this with the year. If 06/16/2005 is the
167th day of the year, the julian would be 2005167
DEFINE
da_misc DATE,
i_julian INTEGER
LET da_misc = "06/16/2005"
LET i_julian = (YEAR(da_misc) * 1000) + da_misc - MDY(1,1,YEAR(da_misc)) + 1
I know all of this works in straight 4GL, but 4Js *could* behave
differently.
Luis Fernando Sergent ([email protected]) wrote :
> I have IDS 9.30.UC1 running under AIX 4.3.3 and BDL 3.50...
>
> I need to extract one date field from a table, but i need it in Julian Mode.
>
> Does anybody know how i can convert from Gregorian to Julian? Or maybe exist
> one prebuild function?
>
> It could be done from sql or BDL
>
> Thanks
>
>
> Luis Fernando Sergent
> Lider de Proyectos Informatica
> Tamayo & Cia, S.A.
> Directo : 58(0212) 603.4747
> Móvil : 58(0416) 634.4860
> Email : [email protected] <mailto:[email protected]>
>
>
--
______________________________________________________________________
Joel Schumacher JCPenney Co. - UNIX Network Systems
[email protected] 6501 Legacy Drive M/S 6108
(972) 431-4044 Plano, TX 75024
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. If the reader of this message is not the intended recipient,
you are hereby notified that your access is unauthorized, and any review,
dissemination, distribution or copying of this message including any
attachments is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete the material from any
computer.