# Formatting a Date

The formatDate routine is easy to use, along with a tJava component:

```
System.out.println(TalendDate.formatDate("dd-MM-yyyy", new Date()));
```

The current date is initialized according to the pattern specified by the new Date() Java function and is displayed in the Run view:

![The result is 2010-02-25 17:28:07 in the Run view.](https://help.qlik.com/talend/en-US/studio-user-guide/Resources/images/routines14_b.png)