# Reports - Save File - FileName - DateFormat

**URL:** <https://forum.inductiveautomation.com/t/reports-save-file-filename-dateformat/57781>\
**Category:** Ignition\
**Created:** [March 29, 2022, 11:14pm UTC](https://forum.inductiveautomation.com/t/reports-save-file-filename-dateformat/57781 "2022-03-29T23:14:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Gray](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@Jason\_Gray](https://forum.inductiveautomation.com/u/Jason_Gray)\
**Post date:** [March 29, 2022, 11:14pm UTC](https://forum.inductiveautomation.com/t/reports-save-file-filename-dateformat/57781/1 "2022-03-29T23:14:09Z")

</div>

Hi All,

I would like to create the filename with yesterdays date, not today. How do I do this??

Can I apply some simple arithmetic within the dateFormat(now(),“yyyyMMdd”) expression?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/0/40e796b92497e8c1220038647b4c0999d6701175.png)

---

<div class="post-metadata">

**Author:** ![kvane](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kvane/32/22228_2.png) [@kvane](https://forum.inductiveautomation.com/u/kvane)\
**Post date:** [March 29, 2022, 11:17pm UTC](https://forum.inductiveautomation.com/t/reports-save-file-filename-dateformat/57781/2 "2022-03-29T23:17:11Z")

</div>

You can place the dateArithmetic() expression around the now() expression and subtract 1 day.

[https://docs.inductiveautomation.com/display/DOC79/dateArithmetic](https://docs.inductiveautomation.com/display/DOC79/dateArithmetic)

It would look somewhat like:  
`dateFormat(dateArithmetic(now(), -1, "days") "yyyyMMdd")`

---

<div class="post-metadata">

**Author:** ![Jason\_Gray](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@Jason\_Gray](https://forum.inductiveautomation.com/u/Jason_Gray)\
**Post date:** [March 29, 2022, 11:26pm UTC](https://forum.inductiveautomation.com/t/reports-save-file-filename-dateformat/57781/3 "2022-03-29T23:26:13Z")

</div>

> [@kvane](#):
>
> dateFormat(dateArithmetic(now(), -1, "days") "yyyyMMdd")

Hi Kvane, Thankyou. It worked.. 🙂
