Sunset, sunrise, twilight calculations in LC?

Bob Sneidar bobsneidar at iotecdigital.com
Wed Aug 27 11:28:45 EDT 2014


Hey thanks for that Kay. I have a date conversion function that includes formats like sqlDate which the LC covert command does not support. This will be a nice addition.

Bob S


On Aug 23, 2014, at 01:28 , Kay C Lan <lan.kc.macmail at gmail.com<mailto:lan.kc.macmail at gmail.com>> wrote:

Nope, but this will help you calculate the Julian Date Number, which
you'll need:

  put the date into tDate
  convert tDate from date to dateItems
  if  ((item 2 of tDate = 1) or (item 2 of tDate = 2)) then
     put 1 into tDay
  else
     put 0 into tDay
  end if
  put item 1 of tDate + 4800 - tDay into tYear
  put item 2 of tDate + (12 * tDay) - 3 into tMonth
  put item 3 of tDate + \
        ((153 * tMonth + 2) div 5) + \
        (365 * tYear) + \
        (tYear div 4) - \
        (tYear div 100) + \
        (tYear div 400) - \
        32045 into tJDN




More information about the use-livecode mailing list