<p>I had <a href="https://github.com/input-output-hk/plutus/issues/3979" rel="nofollow noreferrer">troubles</a> making <code>POSIXTime</code> a part of JSON payload, you can just unwrap the <code>Integer</code> inside and use it instead.</p>
<p>Anyway, JSON serialization is implemented <a href="https://github.com/input-output-hk/plutus/blob/a3697f0ca6c51e8415a1433aa17159ab3986a4f5/plutus-ledger-api/src/Plutus/V1/Ledger/Time.hs#L66" rel="nofollow noreferrer">here</a>, you can check that instance for details.</p>
<p>If you need to convert <code>POSIXTime</code> to standard time format, something like this <a href="https://hackage.haskell.org/package/time-1.12/docs/Data-Time-Clock-POSIX.html#v:posixSecondsToUTCTime" rel="nofollow noreferrer">function</a> would be useful.</p>

CC BY-SA 4.0
2021-09-25T04:47:13.510Z
2021-09-25T04:47:13.510Z
Stanislav Zhdanovich
<p>I have a parameterized contract that includes a POSIXTime as a field called startTime served via PAB.</p>
<p>What is the appropriate stringified HTTP payload to indicate a date with time such as the 25th of September 2021 at noon (no timezone?).</p>

<plutus><plutus-pioneer-program><pab>
POSIXTime as payload
# POSIXTime as payload

(Asked by: username_0 on 2021-09-25)

I have a parameterized contract that includes a POSIXTime as a field called startTime served via PAB.

What is the appropriate stringified HTTP payload to indicate a date with time such as the 25th of September 2021 at noon (no timezone?).

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

---

## 1 answers

### Answer by username_1 on 2021-09-25. Score: 3 | Accepted answer

I had [troubles](https://github.com/input-output-hk/plutus/issues/3979) making `POSIXTime` a part of JSON payload, you can just unwrap the `Integer` inside and use it instead.

Anyway, JSON serialization is implemented [here](https://github.com/input-output-hk/plutus/blob/a3697f0ca6c51e8415a1433aa17159ab3986a4f5/plutus-ledger-api/src/Plutus/V1/Ledger/Time.hs#L66), you can check that instance for details.

If you need to convert `POSIXTime` to standard time format, something like this [function](https://hackage.haskell.org/package/time-1.12/docs/Data-Time-Clock-POSIX.html#v:posixSecondsToUTCTime) would be useful.


---

