how to take the real-time date and time from the server where my jar is deployed on java?

I want to set the creation date of my orders to the date-time when the server received the request, how can I do that in java?

I tried:

```
  Date newDate = new Date();
  Date createdDate = DATE_FORMATTER_SERVER.parse(DATE_FORMATTER_SERVER.format(newDate));

```