Pebble App Framework: Phone API
    Preparing search index...

    Function phoneMidnight

    • The phone's midnight starting a day, as epoch seconds.

      It is worked out from the date, with the offset read at the midnight itself, so a day 23 or 25 hours long across a clock change still starts on its own midnight. The first guess takes the offset at UTC midnight, which is within a day of the answer, and the second takes it there.

      Parameters

      • day: number

        The day's number, as phoneDayNumber gives it.

      • offsetAt: PhoneOffset = phoneOffsetMinutes

        Reads the phone's offset, normally phoneOffsetMinutes.

      Returns number

      The midnight, as epoch seconds.