# Day() function in calculated fields / calculation properties

**URL:** <https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263>\
**Category:** HubSpot Ideas\
**Tags:** properties\
**Created:** [April 5, 2024, 8:14pm UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263 "2024-04-05T20:14:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![03874](https://avatars.discourse-cdn.com/v4/letter/0/c0e974/32.png) [@03874](https://community.hubspot.com/u/03874)\
**Post date:** [April 5, 2024, 8:14pm UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263/1 "2024-04-05T20:14:03Z")

</div>

We really need the integer day of a date to send some awesome, highly personalized emails. I’m not sure how it is that we could have two enterprise hubs 250+ calculation properties but not even a simple day() function.

please help SOS!

---

<div class="post-metadata">

**Author:** ![CBirkett1](https://avatars.discourse-cdn.com/v4/letter/c/f6c823/32.png) [@CBirkett1](https://community.hubspot.com/u/CBirkett1)\
**Post date:** [July 16, 2024, 8:54am UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263/2 "2024-07-16T08:54:49Z")

</div>

Id like this or even just a day() function that can output the day of the month on a date property (similar to the year() and month() function).  
If we have the day() function you can calculate the Day\_of\_Week easily

---

<div class="post-metadata">

**Author:** ![MWogan](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@MWogan](https://community.hubspot.com/u/MWogan)\
**Post date:** [July 25, 2024, 3:46pm UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263/3 "2024-07-25T15:46:32Z")

</div>

Definitely necessary to allow the same functionality as the Year and Month functions

---

<div class="post-metadata">

**Author:** ![FWeberFIS](https://avatars.discourse-cdn.com/v4/letter/f/54ee81/32.png) [@FWeberFIS](https://community.hubspot.com/u/FWeberFIS)\
**Post date:** [August 27, 2024, 12:17pm UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263/4 "2024-08-27T12:17:57Z")

</div>

Hallo, wir benötigen diese Funktion ebenfalls um einen Jahrestag (jährlich wiederkehrender Tag) aus eine, festen Datum ermitteln zu können.  
Vielen Dank

---

<div class="post-metadata">

**Author:** ![FWeberFIS](https://avatars.discourse-cdn.com/v4/letter/f/54ee81/32.png) [@FWeberFIS](https://community.hubspot.com/u/FWeberFIS)\
**Post date:** [August 27, 2024, 12:19pm UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263/5 "2024-08-27T12:19:28Z")

</div>

Hello, we also need this function to be able to determine an anniversary (annually recurring day) from a fixed date.  
Thank you very much

---

<div class="post-metadata">

**Author:** ![CHarro](https://avatars.discourse-cdn.com/v4/letter/c/dec6dc/32.png) [@CHarro](https://community.hubspot.com/u/CHarro)\
**Post date:** [December 16, 2024, 6:11pm UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263/6 "2024-12-16T18:11:41Z")

</div>

Super weird that calculated properties allows month() and year() but not day()

---

<div class="post-metadata">

**Author:** ![PTancredi](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@PTancredi](https://community.hubspot.com/u/PTancredi)\
**Post date:** [March 4, 2025, 10:49pm UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263/7 "2025-03-04T22:49:32Z")

</div>

If there were a **date()** constructor or if you could convert a string into a date you could do a **time\_between()** on the first of the month and the date your trying to get the day from. Unfortunately there’s no way to create a date object.

There is, however, the possibility to use a **date literal** (which is the date in milliseconds since the beginning of 1970), but it gets complicated if you’re spanning multiple years. The example below assumes all of your dates fall into 2025 (1735603200000). It uses **time\_between()** on your date and the beginning of 2025, then divides by milliseconds per day (86400000), then subtracts days in the year from previous months. It outputs a string like “2025-03-04”. If there are multiple years, as I said, it gets more complicated, but is possible.

```lia-code-sample
concatenate(
number_to_string(year([properties.course_start_date])), "-", 
if((month([properties.course_start_date]) > 9), 

number_to_string(month([properties.course_start_date])), concatenate("0", number_to_string(month([properties.course_start_date])))),"-",

number_to_string(
if( month([properties.course_start_date]) == 1, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)),
if( month([properties.course_start_date]) == 2, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)-31),
if( month([properties.course_start_date]) == 3, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)-59),
if( month([properties.course_start_date]) == 4, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)-90),
if( month([properties.course_start_date]) == 5, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)-120),
if( month([properties.course_start_date]) == 6, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)-151),
if( month([properties.course_start_date]) == 7, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)-181),
if( month([properties.course_start_date]) == 8, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)-212),
if( month([properties.course_start_date]) == 9, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)-243),
if( month([properties.course_start_date]) == 10, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)-273),
if( month([properties.course_start_date]) == 11, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)-304),
if( month([properties.course_start_date]) == 12, (round_down(time_between([properties.course_start_date], 1735603200000)/86400000,0)-334),
0))))))))))))))

```

---

<div class="post-metadata">

**Author:** ![katherinebuttar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/katherinebuttar/32/205812_2.png) [@katherinebuttar](https://community.hubspot.com/u/katherinebuttar)\
**Post date:** [April 20, 2025, 7:36am UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263/8 "2025-04-20T07:36:48Z")

</div>

Totally agree, having access to basic functions like day() would make personalization so much easier, especially at scale. In the meantime, this [**date calculator**](https://www.datetimetools.net/date-calculator) might help with quick manual checks or workarounds: Hoping this gets prioritized soon!

---

<div class="post-metadata">

**Author:** ![jkhi](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jkhi](https://community.hubspot.com/u/jkhi)\
**Post date:** [July 17, 2025, 1:21pm UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263/9 "2025-07-17T13:21:37Z")

</div>

It’s not pretty but you can extract the day number into a helper field this with a formula function:

`time_between( subtract_time( subtract_time( [properties.my_date], month([properties.my_date])-1, 'month' ), year([properties.my_date])-1970, 'year' ), (0)) / 86400000 + 1`

---

<div class="post-metadata">

**Author:** ![RDurrance](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@RDurrance](https://community.hubspot.com/u/RDurrance)\
**Post date:** [July 26, 2025, 1:14am UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263/10 "2025-07-26T01:14:43Z")

</div>

Agreed that it’s super weird that we can extract month and year but not day. We really need this for our ongoing workflows & reporting. Hoping this can be implemented quickly.

---

<div class="post-metadata">

**Author:** ![AGAMA\_GLEXBR](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@AGAMA\_GLEXBR](https://community.hubspot.com/u/AGAMA_GLEXBR)\
**Post date:** [November 17, 2026, 8:16pm UTC](https://community.hubspot.com/t/day-function-in-calculated-fields-calculation-properties/104263/11 "2026-11-17T20:16:12Z")

</div>

I dowload my data and work in spreadsheet, it’s deffinitely not the best way to do it, but was the only way I was able to do it.

I hope Hubspot resolve that asap.
