|
-
Sep 8th, 2004, 12:39 PM
#1
Thread Starter
Fanatic Member
Getting the Date & Time??
In my quest for more understanding of the JAVA language, I come to you....
I created a bask JSP that uses JAVA to send data back and forth to a database....my next challenge is within the form I want to place a hidden value that acts like a timestamp...
Then with this value I will send to the database for each record..
So I have been trying to figure out how to go about this...I know in my VB experience a simple var = Now() would do the trick...
But it does not seem to be that easy in JAVA ( at least not to me).
So if someone could help in getting me on the right road, I would be gratefull...
Thank you!
-
Sep 13th, 2004, 02:46 PM
#2
Code:
<%
java.util.Date now = new java.util.Date();
long stamp = now.getTime();
%>
<input type="hidden" name="timestamp" value="<%= stamp %>"/>
Looks easy enough to me
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|