Results 1 to 2 of 2

Thread: Getting the Date & Time??

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Location
    New York
    Posts
    679

    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!

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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
  •  



Click Here to Expand Forum to Full Width