1

I want to know the current time of the machine from which a request is made to my api written in java. Is it possible to do that using some function of HttpServletRequest?

Ole V.V.
  • 81,772
  • 15
  • 137
  • 161
prachi
  • 109
  • 1
  • 10

1 Answers1

0

No! Not using the java api request as requests are created by users .But if you have a UI application sending requests to java application that application can get the client machine's date & your Ui code can send this date in request.

var currentDate = new Date();

you can format and send the date now to server.

Vinay Prajapati
  • 7,199
  • 9
  • 45
  • 86