# How to set a relative due date?

**URL:** <https://discourse.devontechnologies.com/t/how-to-set-a-relative-due-date/71506>\
**Category:** Automation\
**Tags:** automation\
**Created:** [June 18, 2022, 3:16am UTC](https://discourse.devontechnologies.com/t/how-to-set-a-relative-due-date/71506 "2022-06-18T03:16:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cheak](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/c/54ee81/32.png) [@cheak](https://discourse.devontechnologies.com/u/cheak)\
**Post date:** [June 18, 2022, 3:16am UTC](https://discourse.devontechnologies.com/t/how-to-set-a-relative-due-date/71506/1 "2022-06-18T03:16:05Z")

</div>

I have two separate but related questions regarding the (date) format used in applescript especially the one that sets due dates in reminder.

The line in question is this:

```auto
...make new reminder with properties {schedule:once, due date:(current date)}

```

### 1. Date format for (current date)

Let’s say I want to make a new reminder with a specific due date in mind, say 1 Jul 2022. I’ve tried a variety of combination but they ended with “AppleEvent handler failed.” What is the accepted format?

### 2. Set relative reminder at a specific time

If I want to create a reminder with due date “tomorrow 8am” in applescript.

My current script does this:

```auto
set tomDate to ((current date) + 60 * 60 * 24)  

```

…bunch of other stuff

```auto
tell myRecord to make new reminder with properties {schedule:once, due date:tomDate}  

```

Which creates a reminder exactly 24 hours from now. So I only got the “tomorrow” right. What should I be doing so that I can set the relative date (tomorrow), at a specific time (8am)?

---

<div class="post-metadata">

**Author:** ![Blanc](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/blanc/32/8008_2.png) [@Blanc](https://discourse.devontechnologies.com/u/Blanc)\
**Post date:** [June 18, 2022, 4:08am UTC](https://discourse.devontechnologies.com/t/how-to-set-a-relative-due-date/71506/2 "2022-06-18T04:08:29Z")

</div>

Pushed for time here; re. your second question, [here](https://erikslab.com/2007/11/26/date-time-calculations-using-applescript/) is an explainer which should point you in the right direction.

Re your first question, I suspect you need to change your variable to a date, so something along the lines of

```auto
set theDate to "01.07.2022"
set theDate to date theDate

```

It is possible that that code will only work in an external script rather than a script embedded in a smart rule.

---

<div class="post-metadata">

**Author:** ![DTLow](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/dtlow/32/18161_2.png) [@DTLow](https://discourse.devontechnologies.com/u/DTLow)\
**Post date:** [June 18, 2022, 4:26am UTC](https://discourse.devontechnologies.com/t/how-to-set-a-relative-due-date/71506/3 "2022-06-18T04:26:45Z")

</div>

> [@cheak](#):
>
> What should I be doing so that I can set the relative date (tomorrow), at a specific time (8am)?

```auto
set tomDate to (current date) + 1 * days
set time of tomDate to 8 * 60 * 60
```

---

<div class="post-metadata">

**Author:** ![cheak](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/c/54ee81/32.png) [@cheak](https://discourse.devontechnologies.com/u/cheak)\
**Post date:** [June 18, 2022, 8:03am UTC](https://discourse.devontechnologies.com/t/how-to-set-a-relative-due-date/71506/4 "2022-06-18T08:03:56Z")

</div>

Thanks for pointing me to that resource! Seemed that I was overthinking it and the variable is much more straightforward.

---

<div class="post-metadata">

**Author:** ![cheak](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/c/54ee81/32.png) [@cheak](https://discourse.devontechnologies.com/u/cheak)\
**Post date:** [June 18, 2022, 8:04am UTC](https://discourse.devontechnologies.com/t/how-to-set-a-relative-due-date/71506/5 "2022-06-18T08:04:16Z")

</div>

It’s simpler than I thought. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/2X/4/4e6ff70c96be2eb307a274d890bba8d71ba671b3.png) [@system](https://discourse.devontechnologies.com/u/system)\
**Post date:** [June 17, 2025, 8:04am UTC](https://discourse.devontechnologies.com/t/how-to-set-a-relative-due-date/71506/6 "2025-06-17T08:04:33Z")

</div>

This topic was automatically closed 1095 days after the last reply. New replies are no longer allowed.
