# \[Openzeppelin Test-Environment\] setup ganache with a specific timestamp

**URL:** <https://forum.openzeppelin.com/t/openzeppelin-test-environment-setup-ganache-with-a-specific-timestamp/2756>\
**Category:** Support\
**Created:** [April 29, 2020, 4:51pm UTC](https://forum.openzeppelin.com/t/openzeppelin-test-environment-setup-ganache-with-a-specific-timestamp/2756 "2020-04-29T16:51:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Madness](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/madness/32/2189_2.png) [@Madness](https://forum.openzeppelin.com/u/Madness)\
**Post date:** [April 29, 2020, 4:51pm UTC](https://forum.openzeppelin.com/t/openzeppelin-test-environment-setup-ganache-with-a-specific-timestamp/2756/1 "2020-04-29T16:51:03Z")

</div>

I’m trying to test a time-based function and for the sake of making the tests more deterministic I want to force a specific timestamp for the starting block of the ganache instance.

Theoretically, I should be able to do it as Ganache allows it - [https://github.com/trufflesuite/ganache-cli#options-1](https://github.com/trufflesuite/ganache-cli#options-1)

But for some reason I cannot manage to set it up using the `test-environment.config.js` file, is this option available from the `test-environment` side ?

i.e I want to do something like:

```auto
module.exports = {
    node: {
        time: date,
    },
};

```

An alternative would be using the `time` utilities from the `test-helpers` and setup a time in the future with `time.increaseTo()` but I would rather make it work this way tbh.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [May 4, 2020, 6:28am UTC](https://forum.openzeppelin.com/t/openzeppelin-test-environment-setup-ganache-with-a-specific-timestamp/2756/2 "2020-05-04T06:28:53Z")

</div>

Hi @Madness,

I don’t think this is currently possible in OpenZeppelin Test Environment.  
This is the list of what is supported at the moment:  
[https://docs.openzeppelin.com/test-environment/0.1/getting-started#advanced-options](https://docs.openzeppelin.com/test-environment/0.1/getting-started#advanced-options)

So as a work around you would need to look at using OpenZeppelin Test Helpers.

---

<div class="post-metadata">

**Author:** ![ylv-io](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ylv-io/32/331_2.png) [@ylv-io](https://forum.openzeppelin.com/u/ylv-io)\
**Post date:** [May 5, 2020, 1:06am UTC](https://forum.openzeppelin.com/t/openzeppelin-test-environment-setup-ganache-with-a-specific-timestamp/2756/3 "2020-05-05T01:06:04Z")

</div>

Hey @Madness. Unfortunately not at that moment. I’ve created [an issue](https://github.com/OpenZeppelin/openzeppelin-test-environment/issues/104) about it.

---

<div class="post-metadata">

**Author:** ![Madness](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/madness/32/2189_2.png) [@Madness](https://forum.openzeppelin.com/u/Madness)\
**Post date:** [May 5, 2020, 9:52am UTC](https://forum.openzeppelin.com/t/openzeppelin-test-environment-setup-ganache-with-a-specific-timestamp/2756/4 "2020-05-05T09:52:13Z")

</div>

@abcoathup @ylv-io Thank you both for the answers.

For future reference, would you guys rather have these type of questions as an issue in the conrresponding git repo ? Or is the forum the right place for this?

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [May 5, 2020, 9:55am UTC](https://forum.openzeppelin.com/t/openzeppelin-test-environment-setup-ganache-with-a-specific-timestamp/2756/5 "2020-05-05T09:55:24Z")

</div>

Hi @madness,

Thanks for asking 🙏

My preference is the forum. It means more of the community can easily find the question/discussion to contribute (or to find in future).

If an Issue is needed on the repository then we can do it afterwards.

---

<div class="post-metadata">

**Author:** ![Madness](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/madness/32/2189_2.png) [@Madness](https://forum.openzeppelin.com/u/Madness)\
**Post date:** [May 5, 2020, 9:57am UTC](https://forum.openzeppelin.com/t/openzeppelin-test-environment-setup-ganache-with-a-specific-timestamp/2756/6 "2020-05-05T09:57:55Z")

</div>

Wiil keep that in mind, thx !
