Get Time Period on System Start Failing due to getCalendar()

So it wasn’t dead after all - thankfully. Just gremlins.

After altering the Astro 2.0 example you provided, I’m still getting the same issues.

The method getCalendar() from the type DateTimeType is deprecated

rule "Calculate time of day state"
when
    System started or
	Channel 'astro:sun:local:civilDawn#event' triggered START or // Dawn start
    Channel 'astro:sun:local:rise#event' triggered END or  // (Sunrise) Day start
	Channel 'astro:sun:local:civilDusk#event' triggered START or // Civil Dusk with -120 offset, starts to get dark from here
    Channel 'astro:sun:local:set#event' triggered START or // Dusk (Sunset) start
	Channel 'astro:sun:local:eveningNight#event' triggered START or // Evening start
	Channel 'astro:sun:local:morningNight#event' triggered START or // Night start
	Time cron "0 0 6,23,0 * * ? *" // there is currently a bug where only one cron is triggered per rule so I've combined all three into one
then
  Thread::sleep(1000) // make sure we are a tad past midnight to give Astro a chance to recalculate DateTimes for today

  val long morning_start = now.withTimeAtStartOfDay.plusHours(6).millis
  val long day_start = (DayStart_Time.state as DateTimeType).toEpochSecond * 1000
  val long afternoon_start = (TwilightStart_Time.state as DateTimeType).toEpochSecond * 1000
  val long evening_start = (DuskStart_Time.state as DateTimeType).toEpochSecond * 1000
  val long night_start = now.withTimeAtStartOfDay.plusHours(23).millis
  val long bed_start = now.withTimeAtStartOfDay.millis

  var curr = "UNKNOWN"

  switch now {
        case now.isAfter(morning_start) && now.isBefore(day_start):       curr = "MORNING"
        case now.isAfter(day_start) && now.isBefore(afternoon_start):     curr = "DAY"
        case now.isAfter(afternoon_start) && now.isBefore(evening_start): curr = "AFTERNOON"
        case now.isAfter(evening_start) && now.isBefore(night_start):     curr = "EVENING"
        case now.isAfter(night_start):                                    curr = "NIGHT"
        case now.isAfter(bed_start) && now.isBefore(morning_start):       curr = "BED"
  }

  if(TimePeriodOfDay.state.toString != curr) {
    logInfo("EXTRA", "Current time of day is now " + curr)
    TimePeriodOfDay.sendCommand(curr)
  }

end