# Proper unit test mocking for timezone aware DateTime objects

**URL:** <https://forum.elixirforum.com/t/proper-unit-test-mocking-for-timezone-aware-datetime-objects/52789>\
**Category:** Questions\
**Tags:** exunit, datetime, tzdata\
**Created:** [December 27, 2022, 9:01pm UTC](https://forum.elixirforum.com/t/proper-unit-test-mocking-for-timezone-aware-datetime-objects/52789 "2022-12-27T21:01:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dimitarvp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/32/38664_2.png) [@dimitarvp](https://forum.elixirforum.com/u/dimitarvp)\
**Post date:** [December 27, 2022, 9:09pm UTC](https://forum.elixirforum.com/t/proper-unit-test-mocking-for-timezone-aware-datetime-objects/52789/2 "2022-12-27T21:09:29Z")

</div>

Never tried what you need but I’d think that [mock](https://hexdocs.pm/mock/Mock.html) or [patch](https://hexdocs.pm/patch/readme.html) will do the job.

---

_[View the full topic](https://forum.elixirforum.com/t/proper-unit-test-mocking-for-timezone-aware-datetime-objects/52789)._
