Skip to content

replace hardcoded US/Pacific timezone references with timezone.utc#4404

Merged
kartik-mem0 merged 4 commits intomem0ai:mainfrom
amahuli03:4402/bugfix-timestamp-utc
Mar 19, 2026
Merged

replace hardcoded US/Pacific timezone references with timezone.utc#4404
kartik-mem0 merged 4 commits intomem0ai:mainfrom
amahuli03:4402/bugfix-timestamp-utc

Conversation

@amahuli03
Copy link
Copy Markdown
Contributor

Description

Timestamps for created_at and updated_at are hardcoded to US/Pacific, which produces incorrect dates for non-Pacific users and breaks date-range filtering (especially near UTC midnight). This replaces all pytz.timezone("US/Pacific") references with stdlib datetime.timezone.utc and removes the unused pytz imports.

Fixes #4402

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit Test

Exiting tests pass. The change is a straightforward timezone constant swap with no logic changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

Maintainer Checklist

amahuli03 and others added 4 commits March 18, 2026 12:18
- Add _normalize_iso_timestamp_to_utc() helper to convert existing
  timezone-aware timestamps (e.g. US/Pacific -07:00) to UTC on read
- Apply normalization on all read/update paths (sync + async)
- Add tests for create/update UTC timestamps and normalization

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts:
#	mem0/memory/main.py
@kartik-mem0 kartik-mem0 merged commit 08de18f into mem0ai:main Mar 19, 2026
6 of 7 checks passed
jamebobob pushed a commit to jamebobob/mem0-vigil-recall that referenced this pull request Mar 29, 2026
…em0ai#4404)

Co-authored-by: kartik-mem0 <kartik.labhshetwar@mem0.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: created_at and updated_at hardcoded to US/Pacific instead of UTC

2 participants