Acknowledged
CIQQA-3246

[BUG] UNIX Timestamp Y2038/Long Support Needed for Moment and Time APIs

Hi Garmin Dev Team,

I would like to report a critical limitation regarding timestamp handling in Connect IQ, which may soon affect many apps and users:

Issue:

  • All timestamp and time-related APIs (Moment, value(), etc.) currently use Lang.Number (signed 32-bit integer).

  • The maximum value is 2,147,483,647, which corresponds to January 19, 2038 (Y2038 problem).

  • Already today, many valid use cases exist for working with expiration dates, licenses, health events, or logs that extend beyond 2038.

  • Any timestamp calculation or storage above this value cannot be safely represented or compared using Number—developers must use Lang.Long and workarounds.

Why this matters:

  • Business cases (subscriptions, licensing, insurance, medical apps) may need to set or compare dates beyond 2038.

  • Automated testing or user data with future dates can already trigger bugs.

  • This is an industry-wide issue that will affect all Connect IQ apps using time APIs sooner than expected.

Expected Solution:

  • The Connect IQ APIs (e.g., Moment.value(), Time-related methods, persistent storage) should support or return Lang.Long for all timestamps.

  • The documentation and API contracts should clarify this for future-proof apps.

Request:

  • Please consider updating the SDK to natively support 64-bit timestamps.

  • At the very least, please document best practices for safe Long handling of all timestamps and note the Number limitation prominently in the docs.

Thank you for your attention!
A concerned Connect IQ developer

Parents
  • Future-proof Connect IQ timestamp handling example:

    By always converting any time or timestamp value (such as Time.now().value()) to Long using .toLong(), you ensure that your code will work both today (when the API still returns Number), and in the future, if Garmin updates the API to return a Long natively.
    This is the safest and most future-proof pattern for time comparisons, subscriptions, or any timestamp logic on Connect IQ devices.

    var nowLongValue = Time.now().value().toLong();
Comment
  • Future-proof Connect IQ timestamp handling example:

    By always converting any time or timestamp value (such as Time.now().value()) to Long using .toLong(), you ensure that your code will work both today (when the API still returns Number), and in the future, if Garmin updates the API to return a Long natively.
    This is the safest and most future-proof pattern for time comparisons, subscriptions, or any timestamp logic on Connect IQ devices.

    var nowLongValue = Time.now().value().toLong();
Children
No Data