Common Methods error?

I'm using some of the methods in Common Methods | Hubitat Documentation

Most appear to work fine, for example, getSunriseAndSunset returns:
as expected.

But one: timeToday
is causing an error:
{"error":true,"type":"java.lang.Exception","message":"An unexpected error occurred."}

and two:

Don't return any information at all.

Are they implemented?


Works for me. Perhaps not well documented.

        case "sunrise":
            String sunrise = outputFormat.format(getTodaysSunrise())
            return [value: sunrise, dataType: "Date"]
        case "sunset":
            String sunset = outputFormat.format(getTodaysSunset())
            return [value: sunset, dataType: "Date"]
        case "sunriseTomorrow":
            String sunriseTomorrow = outputFormat.format(getTomorrowsSunrise())
            return [value: sunriseTomorrow, dataType: "Date"]
        case "sunsetTomorrow":
            String sunsetTomorrow = outputFormat.format(getTomorrowsSunset())
            return [value: sunsetTomorrow, dataType: "Date"]

I think this is the required import:
import java.text.SimpleDateFormat

Thanks. I added that import. Unfortunately, same issues.

These are all the imports defined in my app.

import groovy.transform.Field
import java.text.SimpleDateFormat
import java.util.Date
import java.time.LocalDate
import java.time.LocalDateTime
import java.text.ParseException
import java.util.regex.Pattern

I'm on a very recent version:

My code accessing those two.

What are you expecting timeToday to return? Sounds a bit like now().

Thanks. Tried those too. I just get a blank response.

Oddly getSunriseAndSunset works perfectly.

I just updated my prior response.

"What are you expecting timeToday to return? Sounds a bit like now()."

I'm hoping it gives me the local time on the hub. I'm writing a custom (off hub) app, and I need to make sure the app's time is the same as the hub's time.

I do remember having an issue with one of the calls but I didn't really need it. I think this one was probably it. But the other two work for me:

Thank you. I think I figured it out. I think the property I was using was incorrect. I'll play with it some more. Much appreciated.