trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
2.62k stars 678 forks source link

Default `chain.time` to UTC timezone when no timezone is provided. #3856

Open tenthirtyone opened 1 year ago

tenthirtyone commented 1 year ago

The switch for chain.time can have different meaning depending on the timezone set by the user's operating system.

--chain.time 2022-10-20T14:51:49 --chain.time 2022-10-20T14:51:49Z

> new Date("2022-10-20T14:51:49").getTime()
1666295509000
> new Date("2022-10-20T14:51:49Z").getTime()
1666277509000

quick search of files: blockchain.ts chain-options.ts

davidmurdoch commented 1 year ago

I think we should throw if the timezone is missing, despite this potentially breaking for some users that use this time format without a timezone. I think this is a bug; we shouldn't be allowing this. Open to other's opinions 👇 (comment below!)