# The first working day of the month

**URL:** <https://forum.robusta.ai/t/the-first-working-day-of-the-month/167>\
**Category:** FAQ\
**Created:** [July 18, 2022, 2:39pm UTC](https://forum.robusta.ai/t/the-first-working-day-of-the-month/167 "2022-07-18T14:39:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilayda.ipar](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robusta.ai/ilayda.ipar/32/56_2.png) [@ilayda.ipar](https://forum.robusta.ai/u/ilayda.ipar)\
**Post date:** [July 18, 2022, 2:39pm UTC](https://forum.robusta.ai/t/the-first-working-day-of-the-month/167/1 "2022-07-18T14:39:42Z")

</div>

Below is the script that gives the first business day of the month in it

⬇

```auto
var date = new Date(), y = date.getFullYear(), m =date.getMonth();
var firstDay = new Date(y, m, 1);
var ilkis = "";
if(firstDay.getDay() == "6"){
   ilkis = firstDay.getDate() + 2;
}
else if(firstDay.getDay() == "0"){
  ilkis = firstDay.getDate() + 1;
}
else{
  ilkis = firstDay.getDate();
}

if (ilkis<10) {
  ilkis = '0' + ilkis;
}
var dayString = ilkis.toString();

var month = date.getMonth()+1;
if (month<10) {
  month = '0' + month;
}
var monthString = month.toString();

var year = date.getUTCFullYear();
var yearString = year.toString();

var firstWorkDay=yearString+'-'+monthString+'-'+dayString+' 09:00:00';

execution.setVariable("firstWorkDay",firstWorkDay);

```
