0

I need to send current time stamp as a hidden input type to another page when the user of the webpage hits Submit button on that page. I'm able to do so with JSP Date() function but it is storing my local machine time because I'm using AEM on localhost.
However I want to send current time stamp in only EST which will be universal to all users hitting the submit button from any geographical location when the form is hosted on AEM server and not on localhost.

Below is the code which is storing local time:
<% Date date = new Date(); %>
<input name="timeStamp" value="<%=date.toString()%>" type="hidden" />

P.S. I'm taking the data from AEM form to Eloqua and for that reason I want to know when did the user filled the form (at what time and date)?

Thanks.

Shawn
  • 8,374
  • 5
  • 37
  • 60
Jineet Vora
  • 329
  • 1
  • 2
  • 12

1 Answers1

0

This is pretty much a Java question. If you want to get the date in a certain time zone using server-side Java code, you should use the built-in Java capabilities.

See How to set time zone of a java.util.Date?

Or see Convert Date/Time for given Timezone - java

Community
  • 1
  • 1
Shawn
  • 8,374
  • 5
  • 37
  • 60