---
title: "Format Date"
id: "format-date"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/format-date"
updated: 2026-07-31T14:56:03Z
---

# Format Date

**Sepasoft MES Module Suite**
 #### Date Formatting

| ![Warning](/resources/Storage/user-manual/user-manual/Warning.png) | Supported Sepasoft Module Versions<br> <br>Release Candidate: 3.81.4 RC6 and later. Stable Version: 3.81.5 and later. |
| --- | --- |

#### Format Date

```python
from java.util import Calendar
cal = Calendar.getInstance()
toDate = cal.getTime()
cal.add(Calendar.DAY_OF_MONTH, -30)
fromDate = cal.getTime()
system.quality.spc.settings.formatDate(fromDate)
system.quality.spc.settings.formatDate(toDate)
```

Output

Code

```
>>> 
u'2018-06-12 14:45:26'
u'2018-07-12 14:45:26'
>>> 
```


**Sepasoft MES Module Suite**