?
Just some JavaScript to give you an idea:    var now = new Date();
    var timeStr = "";
    timeStr = now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate() + " ";
    timeStr += now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds();

解决方案 »

  1.   

    <whatever att="<%=new SimpleDateFormat("HH:mm:ss").format(YourDateObject)%>">or <whatever att="<%=YourDateString.substring(YourDateString.indexOf(' ')+1)%>">
      

  2.   

    oh,why in English?from the database you can get an object of java.sql.Date,so what you need to do is to transformat it, like this :-----------------------------------------
    <%@ page session="true" %>
    <%@ page import="java.text.SimpleDateFormat,java.sql.Date"%>
    <html>
    <head>
    <title>emu</title>
    </head>
    <body>
    <%
    SimpleDateFormat formatter;
    Date d = new Date(0);
    out.println(d+"<br>");
    formatter=new SimpleDateFormat("yyyy-mm-dd");
    out.println(formatter.format(d)+"<br>");
    formatter=new SimpleDateFormat("yyyy/mm/dd");
    out.println(formatter.format(d)+"<br>");
    formatter=new SimpleDateFormat("yy-mm-dd");
    out.println(formatter.format(d)+"<br>");
    formatter=new SimpleDateFormat("yy/mm/dd");
    out.println(formatter.format(d)+"<br>");
    %>
    </body>
    </html>
    -----------------------------------------btw,the Date class in java.sql package is inherit from the one in java.util,and the formatter can work with both.Class Datejava.lang.Object
      |
      +--java.util.Date
            |
            +--java.sql.Date
      

  3.   

    oh i made a mistake,must like this:
    -----------------------------------------------
    <%@ page session="true" %>
    <%@ page import="java.text.SimpleDateFormat,java.sql.Date"%>
    <html>
    <head>
    <title>emu</title>
    </head>
    <body>
    <%
    SimpleDateFormat formatter;
    Date d = new Date(0);
    out.println(d+"<br>");
    formatter=new SimpleDateFormat("yyyy-MM-DD");
    out.println(formatter.format(d)+"<br>");
    formatter=new SimpleDateFormat("yyyy/MM/DD");
    out.println(formatter.format(d)+"<br>");
    formatter=new SimpleDateFormat("yy-MM-DD");
    out.println(formatter.format(d)+"<br>");
    formatter=new SimpleDateFormat("yy/MM/DD");
    out.println(formatter.format(d)+"<br>");
    %>
    </body>
    </html>
    -----------------------------------------------m means minute and M means Month
      

  4.   

    God! I mistake again. D means day in year and d means day in month.
    -----------------------------------------------
    <%@ page session="true" %>
    <%@ page import="java.text.SimpleDateFormat,java.sql.Date"%>
    <html>
    <head>
    <title>emu</title>
    </head>
    <body>
    <%
    SimpleDateFormat formatter;
    Date d = new Date(Long.parseLong("1000000000000"));
    out.println(d+"<br>");
    formatter=new SimpleDateFormat("yyyy-MM-dd");
    out.println(formatter.format(d)+"<br>");
    formatter=new SimpleDateFormat("yyyy/MM/dd");
    out.println(formatter.format(d)+"<br>");
    formatter=new SimpleDateFormat("yy-MM-dd");
    out.println(formatter.format(d)+"<br>");
    formatter=new SimpleDateFormat("yy/MM/dd");
    out.println(formatter.format(d)+"<br>");
    %>
    </body>
    </html>
    -----------------------------------------------see this: Symbol   Meaning                
     ------   -------                
     G        era designator         
     y        year                   
     M        month in year          
     d        day in month           
     h        hour in am/pm (1~12)   
     H        hour in day (0~23)     
     m        minute in hour         
     s        second in minute       
     S        millisecond            
     E        day in week            
     D        day in year            
     F        day of week in month   
     w        week in year           
     W        week in month          
     a        am/pm er           
     k        hour in day (1~24)     
     K        hour in am/pm (0~11)   
     z        time zone              
     '        escape for text        
     ''       single quote           
      

  5.   

    What's the meaning of the Date d = new 
    Date(Long.parseLong("1000000000000"));
    why need to use the 1000000000000 to get the 2001-09-09 date, how to caculate?and other question if i need to email reminder, that's mean i have a timesheet table and have an attribute in this table (submission_date). If the date in this attribute is late for each monday then we need to automatically to generate an email to reminder the staff to submit their timesheet. This procedure is in oracle or in jsp? i can't find any method to realise.
      

  6.   

    Date----------------------------------------------public Date(long date)
    Constructs a Date object using a milliseconds time value. If the given milliseconds value contains time information, the driver will set the time components to the time in the default time zone (the time zone of the Java virtual machine running the application) that corresponds to zero GMT.-------------------------------------------------------public Date(int year,
                int month,
                int day)
    Deprecated. instead use the constructor Date(long date)Constructs a Date object initialized with the given year, month, and day.The result is undefined if a given argument is out of bounds.Parameters:year - the year minus 1900; must be 0 - 9999
    month - 0 to 11
    day - 1 to 31-----------------------------------------------------------
    public Date(int year,
                int month,
                int date,
                int hrs,
                int min)
    Deprecated. As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min) or GregorianCalendar(year + 1900, month, date, hrs, min).Allocates a Date object and initializes it so that it represents the instant at the start of the minute specified by the year, month, date, hrs, and min arguments, in the local time zone.Parameters:year - the year minus 1900.
    month - the month between 0-11.
    date - the day of the month between 1-31.
    hrs - the hours between 0-23.
    min - the minutes between 0-59.See Also:Calendar
      

  7.   

    neither in jsp nor in oracle,you shoud check the table termly in a thread.
      

  8.   

    NB!YOU ARE SO NB IN ENGLISH!
      

  9.   

    in oracle:
    select to_date(start_time,'yyyy-mm-dd') from tablename
    select to_date(start_time,'yyyy/mm/dd') from tablename
    select to_date(start_time,'yy/mm/dd') from tablename
    ....