# Need help with homeyscript

**URL:** <https://community.homey.app/t/need-help-with-homeyscript/79813>\
**Category:** Developers\
**Created:** [April 28, 2023, 12:12pm UTC](https://community.homey.app/t/need-help-with-homeyscript/79813 "2023-04-28T12:12:53Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [April 28, 2023, 2:33pm UTC](https://community.homey.app/t/need-help-with-homeyscript/79813/7 "2023-04-28T14:33:58Z")

</div>

@robertklep Thanks! A little hacking and googling, this seems to work 🙂

```auto
// Get the current Unix timestamp (epoch) in seconds

const unixTimestamp = Math.floor(Date.now() / 1000);

//console.log(unixTimestamp);

//console.log("Encoded string: "+ Buffer.from(unixTimestamp.toString()).toString('Base64'));

//console.log("Decoded string: ", decodedString);

return Buffer.from(unixTimestamp.toString()).toString('Base64');

```

Now, back to the search function for the rest of my query 🙂

---

_[View the full topic](https://community.homey.app/t/need-help-with-homeyscript/79813)._
