# Changing the date returned by CurrentDateTime

**URL:** <https://forum.inductiveautomation.com/t/changing-the-date-returned-by-currentdatetime/8621>\
**Category:** Ignition\
**Created:** [June 25, 2014, 11:09pm UTC](https://forum.inductiveautomation.com/t/changing-the-date-returned-by-currentdatetime/8621 "2014-06-25T23:09:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjanowiak](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jjanowiak](https://forum.inductiveautomation.com/u/jjanowiak)\
**Post date:** [June 25, 2014, 11:09pm UTC](https://forum.inductiveautomation.com/t/changing-the-date-returned-by-currentdatetime/8621/1 "2014-06-25T23:09:20Z")

</div>

I am new to expressions in Ignition.  
I can format the string returned by CurrentDateTime by using,  
dateFormat({[System]Gateway/CurrentDateTime}, “MM/dd/yy”)

Now what I can’t figure out is how to change the value returned.

Example: the string above returnes the current date (06/25/14)  
What I want to display is the date for yesterday i.e. (06/24/14)

How do I change the value of the date returned??

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [June 25, 2014, 11:25pm UTC](https://forum.inductiveautomation.com/t/changing-the-date-returned-by-currentdatetime/8621/2 "2014-06-25T23:25:46Z")

</div>

You can use the datearithmetic function.

```auto
dateFormat(dateArithmetic({[System]Gateway/CurrentDateTime},-1,"day"),"MM/dd/yy")
```

---

<div class="post-metadata">

**Author:** ![jjanowiak](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jjanowiak](https://forum.inductiveautomation.com/u/jjanowiak)\
**Post date:** [June 27, 2014, 4:34am UTC](https://forum.inductiveautomation.com/t/changing-the-date-returned-by-currentdatetime/8621/3 "2014-06-27T04:34:16Z")

</div>

Thank you very much. Just what I was looking for.
