# Epoch time with 18 digits

**URL:** <https://community.postman.com/t/epoch-time-with-18-digits/19672>\
**Category:** Help Hub\
**Tags:** pre-request\
**Created:** [January 28, 2021, 11:21pm UTC](https://community.postman.com/t/epoch-time-with-18-digits/19672 "2021-01-28T23:21:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![taehoshino](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/taehoshino/32/6608_2.png) [@taehoshino](https://community.postman.com/u/taehoshino)\
**Post date:** [January 29, 2021, 6:22am UTC](https://community.postman.com/t/epoch-time-with-18-digits/19672/2 "2021-01-29T06:22:33Z")

</div>

Hi @mark.sadegursky!

I tried my best but looks like we need `process.hrtime()` in order to make it work.  
However, `process` module is not available as discussed [here](https://community.postman.com/t/error-cannot-find-module-process-in-pre-request-script-when-calling-process-cwd/341) ☹

If this module was available, it would be possible to utilise one of external libraries such as [this one](https://github.com/sazze/node-nanotime/blob/master/index.js) to make it work by leveraging `eval()` function, e.g.

In pre-request:

```
pm.sendRequest('https://peterolson.github.io/BigInteger.js/BigInteger.min.js', (err, res) => {
    if (err) {
        console.log(err)
    } else {
        pm.environment.set('bigInt', res.text())
    }
})

```

In test script:

```
eval(pm.environment.get('bigInt'))
//const loadNs = process.hrtime();
const loadMs = new Date().getTime();
const diffNs = [8, 886896255] // should really be process.hrtime(loadNs)
const value = bigInt(loadMs).times(1e6).add(bigInt(diffNs[0]).times(1e9).plus(diffNs[1])).toString();
console.log(value)

```

I hope you find this helpful a bit 🙂

---

_[View the full topic](https://community.postman.com/t/epoch-time-with-18-digits/19672)._
