# Local time in HomeyScript

**URL:** <https://community.homey.app/t/local-time-in-homeyscript/33338>\
**Category:** Questions & Help\
**Tags:** homeyscript\
**Created:** [August 7, 2020, 7:04am UTC](https://community.homey.app/t/local-time-in-homeyscript/33338 "2020-08-07T07:04:53Z")\
**Posts on this page:** 1\
**Showing post:** 35

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [July 15, 2022, 10:02am UTC](https://community.homey.app/t/local-time-in-homeyscript/33338/35 "2022-07-15T10:02:45Z")

</div>

I’m using this:  
let tz = this.homey.clock.getTimezone();  
now = new Date().toLocaleString(this.homey.i18n.getLanguage(),  
{  
hour12: false,  
timeZone: tz,  
hour: “2-digit”,  
minute: “2-digit”,  
day: “2-digit”,  
month: “2-digit”,  
year: “numeric”  
});

I use this.homey.i18n.getLanguage() as timezone, even if it’s only the first part of the zone (en or nb for you).  
toLocaleString is returning the formated local string depoending on the zone/language sind FW 7.4. FW \<7.4 is only returning the “en-US” version.  
But the timezone was waorking in older FWs, too.

---

_[View the full topic](https://community.homey.app/t/local-time-in-homeyscript/33338)._
