0

I'm completely new to JSP but not Java

<div>
<%@ page import="java.util.*" %>
<%= 
	Date date = new Date();
	out.println(date.getHours()+":"+date.getMinutes()+":"+date.getSeconds());
	%>
</div>

All I need is

Hour:Minute:Second

. (Edit: stupid emoticons)
I'm getting this error on Date

Multiple annotations found at this line:
	- Syntax error, insert ")" to complete 
	 MethodInvocation
	- Syntax error, insert ";" to complete Statement
	- Syntax error, insert ";" to complete Statement
	- Syntax error, insert ")" to complete 
	 MethodInvocation

and this at the end on %>

Multiple annotations found at this line:
	- Syntax error on token ")", delete this 
	 token
	- Syntax error on token ")", class 
	 expected
	- Syntax error on token ")", invalid 
	 Expression
	- Syntax error on token ")", delete this 
	 token

Edited by Slyvr: n/a

1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Slyvr
0

Nevermind...found the issue was
<%=
Needs to be
<%

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.