Skip to content

fix: use timezone-aware cookbook timestamp#8061

Merged
kausmeows merged 2 commits into
agno-agi:mainfrom
Ghraven:fix/dynamic-tools-timezone-aware
May 24, 2026
Merged

fix: use timezone-aware cookbook timestamp#8061
kausmeows merged 2 commits into
agno-agi:mainfrom
Ghraven:fix/dynamic-tools-timezone-aware

Conversation

@Ghraven

@Ghraven Ghraven commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace datetime.utcnow() in the dynamic tools cookbook with datetime.now(timezone.utc)
  • Keep the example output explicitly UTC and timezone-aware

Closes #8060

Problem

The cookbook example returns the current time with datetime.utcnow().isoformat(). That produces a naive datetime and datetime.utcnow() is deprecated in Python 3.12.

Before / After

Before:

return datetime.utcnow().isoformat()

After:

return datetime.now(timezone.utc).isoformat()

The returned timestamp now includes UTC timezone information.

Verification

  • python -m compileall -q cookbook\02_agents\15_dependencies\dynamic_tools.py
  • git diff --check

This is a cookbook-only timestamp cleanup, so I did not run the full test suite.

@Ghraven Ghraven requested a review from a team as a code owner May 22, 2026 04:28

@kausmeows kausmeows left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @Ghraven!

@kausmeows kausmeows merged commit f9b4931 into agno-agi:main May 24, 2026
5 checks passed
@Ghraven

Ghraven commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for reviewing and merging this, I appreciate it!

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.

Use timezone-aware UTC timestamp in dynamic tools cookbook

2 participants