---
title: "Set a date field to today's date - Groovy"
canonical: "https://support.appfire.com/space/JMWE/461996831/Set%20a%20date%20field%20to%20today's%20date%20-%20Groovy"
format: markdown
---
> Macro (aura-html)

### Abstract

This code snippet sets a date field to today's date 

### Logic

Pass today's date

### Snippet 

```groovy
new Date()
```

###   
Examples

<span style="color: #333333">The output of this code snippet is a</span><span style="color: #333333"> </span>[Timestamp](http://docs.oracle.com/javase/7/docs/api/java/sql/Timestamp.html)<span style="color: #333333"> </span><span style="color: #333333">which you could use in:</span>

**<span style="color: #333333">A Groovy expression, for example to:</span>**

- Set <span style="color: #333333">a Date/Date-time picker field</span><span style="color: #333333"> </span><span style="color: #333333">- Eg: Set the Due date to today's date in</span>
  - one of the Set Field Value post-functions
  - the Create issue post-function under Set fields of new issue section
- Conditionally execute a Post-function/Condition/Validator or Unlink issues  - Eg: Estimated delivery date is less than today

**A Groovy template, for example to:**

- <span style="color: #333333">Notify the customer when the issue has been rejected as invalid through the</span>
  - Comment in one of the Comment issue post-functions
  - Subject/HTML body/Text body of Email issue post-function
- Write a JQL search expression in Link issues to the current issue post-function. Eg: Link issues which have been created since yesterday

### References

- [Accessing the fields of an issue](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461537562)
- [**Groovy Documentation**](http://groovy.codehaus.org/User+Guide)

### Related articles

> Macro (contentbylabel)

> Macro (details)
> 
> | **Related issues** |  |
> | --- | --- |