<p>As is typical, I figured out what's wrong almost immediately after posting the question. I was on the wrong commit for my local checkout of the plutus repo. I was using commit <code>ea0ca4e9f9821a9dbfc5255fa0f42b6f2b3887c4</code> which comes from the <a href="https://github.com/paymog/plutus-pioneer-program/blob/main/code/week01/cabal.project#L28" rel="nofollow noreferrer">week 1 <code>cabal.project</code> file</a>.</p>
<p>The <a href="https://github.com/paymog/plutus-pioneer-program/blob/main/code/week03/cabal.project#L28" rel="nofollow noreferrer">week 3 <code>cabal.project</code> file</a> requires <code>plutus</code> at commit <code>219992289c6615e197069d022735cb4059d43229</code>. After I made that change, the issue resolved itself.</p>

CC BY-SA 4.0
2021-10-02T20:36:19.833Z
2021-10-02T20:36:19.833Z
Paymahn Moghadasian
<p>I think my <code>plutus-playground-server</code> has an incorrect notion of time. I'm working on the homework for lecture 3 and keep running into issues with the simulator.</p>
<p>Here's a screenshot of what I'm simulating for homework 2 of week 3:</p>
<p><a href="https://i.sstatic.net/puLjY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/puLjY.png" alt="enter image description here" /></a></p>
<p>I've verified that, according to the cabal repl, <code>1596059101000</code> is slot 10.</p>
<pre><code>Prelude Ledger Wallet.Emulator Data.Default Ledger.TimeSlot Week03.Homework2&gt; slotToBeginPOSIXTime de
f 10
POSIXTime {getPOSIXTime = 1596059101000}
</code></pre>
<p>Note that in the example simulation I <code>Wait Until Slot 11</code>.</p>
<p>I've changed the following line when constructing transactions clientside to <code>show now</code>: <a href="https://github.com/paymog/plutus-pioneer-program/commit/4098f73bef4191ebc976fb8c2c3d46ee53f97b5e#diff-7fd9bde64b988d6aa9520167ed285990ed737f5dbda967ac19c786ff4160bb36R105" rel="nofollow noreferrer">https://github.com/paymog/plutus-pioneer-program/commit/4098f73bef4191ebc976fb8c2c3d46ee53f97b5e#diff-7fd9bde64b988d6aa9520167ed285990ed737f5dbda967ac19c786ff4160bb36R105</a></p>
<p>Interesting, when I execute the above simulation, I see the following output:</p>
<pre><code>Add slot 11
Contract instance for wallet 2: (ReceiveEndpointCall (EndpointDescription { getEndpointDescription: &quot;grab&quot; }) (RawJson &quot;{\&quot;contents\&quot;:[{\&quot;getEndpointDescription\&quot;:\&quot;grab\&quot;},{\&quot;unEndpointValue\&quot;:[]}],\&quot;tag\&quot;:\&quot;ExposeEndpointResp\&quot;}&quot;))
Contract instance for wallet 2: (ContractLog (RawJson &quot;no gifts available at time POSIXTime {getPOSIXTime = 1596059102}&quot;))
</code></pre>
<p>Note that the value of <code>now</code> is <code>1596059102</code> which is missing three trailing zeroes compared to <code>1596059101000</code>. If I check the posix time of slot 11 in the <code>cabal repl</code> I see</p>
<pre><code>Prelude Ledger.TimeSlot Data.Default Week03.Homework1&gt; slotToBeginPOSIXTime def 11
POSIXTime {getPOSIXTime = 1596059102000}
</code></pre>
<p>which is the value reported by the simulation with 3 extra trailing zeroes.</p>
<p>Does my instance of the <code>plutus-playground-server</code> have a &quot;incorrect&quot; notion of time?</p>

<plutus-pioneer-program><plutus-playground>
plutus-playground-server sense of time is incorrect
# plutus-playground-server sense of time is incorrect

(Asked by: username_0 on 2021-10-02)

I think my plutus-playground-server has an incorrect notion of time. I'm working on the homework for lecture 3 and keep running into issues with the simulator.
Here's a screenshot of what I'm simulating for homework 2 of week 3:

I've verified that, according to the cabal repl, 1596059101000 is slot 10.
Prelude Ledger Wallet.Emulator Data.Default Ledger.TimeSlot Week03.Homework2> slotToBeginPOSIXTime de
f 10
POSIXTime {getPOSIXTime = 1596059101000}

Note that in the example simulation I Wait Until Slot 11.
I've changed the following line when constructing transactions clientside to show now: https://github.com/paymog/plutus-pioneer-program/commit/4098f73bef4191ebc976fb8c2c3d46ee53f97b5e#diff-7fd9bde64b988d6aa9520167ed285990ed737f5dbda967ac19c786ff4160bb36R105
Interesting, when I execute the above simulation, I see the following output:
Add slot 11
Contract instance for wallet 2: (ReceiveEndpointCall (EndpointDescription { getEndpointDescription: "grab" }) (RawJson "{\"contents\":[{\"getEndpointDescription\":\"grab\"},{\"unEndpointValue\":[]}],\"tag\":\"ExposeEndpointResp\"}"))
Contract instance for wallet 2: (ContractLog (RawJson "no gifts available at time POSIXTime {getPOSIXTime = 1596059102}"))

Note that the value of now is 1596059102 which is missing three trailing zeroes compared to 1596059101000. If I check the posix time of slot 11 in the cabal repl I see
Prelude Ledger.TimeSlot Data.Default Week03.Homework1> slotToBeginPOSIXTime def 11
POSIXTime {getPOSIXTime = 1596059102000}

which is the value reported by the simulation with 3 extra trailing zeroes.
Does my instance of the plutus-playground-server have a "incorrect" notion of time?

**Tags:** plutus-pioneer-program, plutus-playground

---

## 1 answers

### Answer by username_0 on 2021-10-02. Score: 0 | Accepted answer

As is typical, I figured out what's wrong almost immediately after posting the question. I was on the wrong commit for my local checkout of the plutus repo. I was using commit `ea0ca4e9f9821a9dbfc5255fa0f42b6f2b3887c4` which comes from the [week 1 `cabal.project` file](https://github.com/paymog/plutus-pioneer-program/blob/main/code/week01/cabal.project#L28).

The [week 3 `cabal.project` file](https://github.com/paymog/plutus-pioneer-program/blob/main/code/week03/cabal.project#L28) requires `plutus` at commit `219992289c6615e197069d022735cb4059d43229`. After I made that change, the issue resolved itself.


---

