How do I get the server time using REST GET HTTP? Is it possible to get the time from Drupal 8 with GET HTTP and REST?

I get the date format from /entity/date_format/long, which returns a value similar to the following one.

{
"uuid": "76e070cb-a783-47bf-89cc-db9f393a7d59",
"langcode": "en",
"status": true,
"dependencies": [],
"id": "long",
"label": "Default long date",
"locked": false,
"pattern": "l, F j, Y - H:i"


}

It is not what I need. I need to get the server time, so I can after synchronize some dates.
/entity/date_format/long is just giving information on the date format

The easiest and cleanest way to do this is probably to create a simple custom REST resource in a custom module and within the resource you can return the server time using php functions

$message = [
    'time' =&gt; date("Y-m-d H:i:s"),
    'timezone' =&gt; date_default_timezone_get(),
];


You also have to implement CacheableResponseInterface in order to get the current time on every call to the service otherwise you are going to get a cached response.

Here is a working REST API time service module for this which I did just for the sake of this exercise