# Wintertime / month

**URL:** <https://community.homey.app/t/wintertime-month/71516>\
**Category:** Apps\
**Created:** [November 1, 2022, 12:42pm UTC](https://community.homey.app/t/wintertime-month/71516 "2022-11-01T12:42:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![olivier1870](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/olivier1870/32/51700_2.png) [@olivier1870](https://community.homey.app/u/olivier1870)\
**Post date:** [November 1, 2022, 12:42pm UTC](https://community.homey.app/t/wintertime-month/71516/1 "2022-11-01T12:42:48Z")

</div>

Hi  
I m trying to find a way (an app) which could return the month, or whether its winter or summer time!  
Any help would be welcome!

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [November 1, 2022, 4:03pm UTC](https://community.homey.app/t/wintertime-month/71516/2 "2022-11-01T16:03:12Z")

</div>

Hi Olivier,

Nice puzzle!  
I created a script, you can use it in an Adv.flow like this:

 ![Screenshot 2022-11-01 at 17-02-21 1.HomeyPro Peter](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/8/7816ac6f3678e3d8bc7b461a6f68d84d1ea4e6b3.png)

Script:

```auto
// This script creates/updates a tag named NameOfMonth and DST time (Summer/Winter)

// USER INPUT
    // Enter your wintertime timezone offset from UTC time, f.i. +1 (Paris), +2 (Helsinki), -3 (Rio de Janeiro)
var myOffset = +1;
    // Optional: Enter your local translations
var Summer = "Summer/Zomer/Sommer/Été/El verano"
var Winter = "Winter/l'Hiver/Invierno"
// END OF USER INPUT

let SysInfo = await Homey.system.getInfo();
var tempS = SysInfo.dateHuman.slice(SysInfo.dateHuman.indexOf(' ')+1);
    temp = tempS.slice(tempS.indexOf(' ')+1);
var MonthName = temp.slice(0,temp.indexOf(' '));
var theLocalHour = SysInfo.dateHuman.slice((SysInfo.dateHuman.length)-8,(SysInfo.dateHuman.length)-6);

const dateUTC = new Date();
var dst = "Something's wrong"
let utcHour = dateUTC.getUTCHours();
  // adjust offset hours to your timezone
  if ( myOffset == theLocalHour - utcHour ) { // The offset returned by this function = 0 while it = +1 in NL/Amsterdam
    dst = Winter
  }
  else
  dst = Summer;

//creating new HomeyScript Tag / Variable 'NameOfMonth'
await tag("NameOfMonth", MonthName);
//creating new HomeyScript Tag / Variable 'DST_time'
await tag("DST_time",dst);

// console.log("Month:", MonthName,"\nDST:",dst,"\n");
// Timestamps check
console.log("(Local hour="+theLocalHour,"| UTC hour="+utcHour+")");

return("Month: " + MonthName + ", " + "DST: " + dst);

```

Returned data:

> ![Screenshot from 2022-11-01 16-59-16](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/1/51a165860a7094d4b8a38f8dbcca55fce459bf01.png)
