# Expression Binding to get Week of Year

**URL:** <https://forum.inductiveautomation.com/t/expression-binding-to-get-week-of-year/80524>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 16, 2023, 10:33am UTC](https://forum.inductiveautomation.com/t/expression-binding-to-get-week-of-year/80524 "2023-10-16T10:33:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roisin\_McGuire](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/roisin_mcguire/32/63343_2.png) [@Roisin\_McGuire](https://forum.inductiveautomation.com/u/Roisin_McGuire)\
**Post date:** [October 16, 2023, 10:33am UTC](https://forum.inductiveautomation.com/t/expression-binding-to-get-week-of-year/80524/1 "2023-10-16T10:33:31Z")

</div>

I notice there is an expression binding to get the Quarter of the Year from a date but is there an equivalent expression to get the Week of the Year? I have this one to get the quarter and another one to get the year:

```
getQuarter({../DateTimePicker.props.value})

```

I assume a custom transform would work if not.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 16, 2023, 10:54am UTC](https://forum.inductiveautomation.com/t/expression-binding-to-get-week-of-year/80524/2 "2023-10-16T10:54:33Z")

</div>

```python
dateExtract({../DateTimePicker.props.value}, 'week')

```

May not be ISO, however.

This would give an ISO week of year

> [@How to extract WEEK\_OF\_YEAR from java.util.date?](https://forum.inductiveautomation.com/t/how-to-extract-week-of-year-from-java-util-date/50310/13):
>
> java.time was added to overcome the inconsistency of Calendar. from java.time import ZoneId from java.time.temporal import IsoFields now = system.date.now() date = now.toInstant().atZone(ZoneId.systemDefault()).toLocalDate() week = date.get(IsoFields.WEEK\_OF\_WEEK\_BASED\_YEAR) print now print date print week

---

<div class="post-metadata">

**Author:** ![Roisin\_McGuire](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/roisin_mcguire/32/63343_2.png) [@Roisin\_McGuire](https://forum.inductiveautomation.com/u/Roisin_McGuire)\
**Post date:** [October 16, 2023, 11:13am UTC](https://forum.inductiveautomation.com/t/expression-binding-to-get-week-of-year/80524/3 "2023-10-16T11:13:57Z")

</div>

thank you, that's perfect
