I have implemented a timed crowdsale contract and it's constructor is like this:

function NeoCrowdsale(uint256 _openingTime, uint256 _closingTime) public {
    require(_openingTime >= now);
    require(_closingTime >= _openingTime);

    openingTime = _openingTime;
    closingTime = _closingTime;

I need to deploy it to ropsten using remix, while creating it, I have to pass the opening and closing time, this is the screenshot where I need to specify it:

enter image description here

I'm just wondering the format to enter time in it along date, can anyone help me with this? If I want to deploy it on 31 march 2018 at 10:00 am

Thanks, any help will be appreciated !

2 Answers 2


To find the right times, you need to know what now or blockstamp.timestamp represents. This is UNIX time.

To quickly find this, use https://www.unixtimestamp.com/

To confirm this is right, create a function which returns the current timestamp. Now in your browser, enter Date.now()/1000 (Date.now() returns microseconds) in your console. This is the current UNIX timestamp (and has nothing to do with your timezone), confirming that it is a UNIX timestmap.

  1. Go to https://www.unixtimestamp.com/ as mentioned by @MathematicalRain to see the Timestamp converter.
  2. Enter the time and date you want then click convert it to change it to Unix Time Stamp (in seconds).
  3. go to Remix and put the seconds there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.