[Coco] Julian Date

Gregory Law glaw at live.com
Wed May 24 17:22:25 EDT 2017


This is Basic09 on OS-9/NitrOS-9.

On 5/24/2017 5:18:54 PM, "Wayne Campbell" <asa.rand at gmail.com> wrote:

>I find these two functions interesting. What language is it?
>
>It looks like BASIC, but I've never seen a function in basic written 
>this
>way before.
>
>
>On May 23, 2017 7:37 PM, "Luis Fernández" <luis46coco at hotmail.com> 
>wrote:
>
>>  OR
>>
>>
>>  FUNCTION FechaJulDMA (tjul, dd, mm, aa)
>>  T = tjul + 62
>>  t2 = FIX(T / 1461) * 4 + 1700
>>  t1 = T MOD 1461
>>  IF t1 > 365 THEN
>>  t1 = t1 - 1
>>  oa = FIX(t1 / 365)
>>  t1 = t1 MOD 365
>>  END IF
>>  aa = t2 + oa
>>  dias = t1 + 1
>>  dd = dias
>>  swb = 1 - SGN(oa)
>>  IF dd > 212 + swb THEN dd = dd + 30
>>  IF dd > 59 + swb THEN dd = dd + 2 - swb
>>  mm = FIX(dd / 61) * 2 + 1
>>  dd = dd MOD 61
>>  IF dd > 31 THEN mm = mm + 1: dd = dd - 31
>>  IF mm > 7 THEN mm = mm - 1
>>  FechaJulDMA = dias
>>  END FUNCTION
>>



More information about the Coco mailing list