Skip to content

Session lastUpdateTime not in UTC when using SQLite DB #1180

@cschmidterNBTC

Description

@cschmidterNBTC

Describe the bug
The lastUpdateTime for a session (from GET sessions) are not UTC when using a SQLite DB

For example, if the app server's local timezone is EDT (UTC-4):

  1. SQLite func.now() stores actual UTC time, e.g., "2025-06-05 13:00:00".
  2. SQLAlchemy reads this as naive datetime(2025, 6, 5, 13, 0, 0).
  3. Python's naive_dt.timestamp() interprets 13:00:00 as 13:00:00 EDT.
  4. This converts to a Unix timestamp for 17:00:00 UTC (13:00 EDT + 4 hours).
  5. The client receives a timestamp for 4 hours in the future compared to the actual UTC event.

To Reproduce
Steps to reproduce the behavior:

  1. Set up google-adk with a SQLite DB
  2. Create and then retrieve a session.
  3. Observe the session.last_update_time value. It will be a Unix timestamp representing a UTC time that is [offset] hours ahead of the actual UTC time of the update. (The offset will match the app server's local timezone offset from UTC).

Expected behavior
The timestamp should be in UTC

Desktop:

  • OS: Windows
  • Python version: 3.13
  • ADK version: 1.0.0

Metadata

Metadata

Assignees

Labels

services[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions