cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the current date using HTMLB JSP page

Former Member
0 Kudos

Hi All, I developed an iview with several fields using PDK, I would like to know how can I include for a date field a dynamic value witch in this case is the current date.

<hbj:inputField

id="Date"

type="date"

maxlength="10"

showHelp="TRUE"

required="TRUE"

value="???"

/>

Thanks in advance

Alexis

Accepted Solutions (0)

Answers (3)

Answers (3)

kishorg
Advisor
Advisor
0 Kudos

Hi Alexis ,

u can use the setDate("3.12.2003") function to set date for this input field.

u just change the id = Date , because in jave we have Date class. rename it to another name..

suppose id = systemDate

<%

Format formater = new SimpleDateFormat("dd.MM.yyyy");

Date syDatum = new Date();

%>

then

put

systemDate.setDate(formater.format(syDatum));

this will set the date .....

Regards

Kishor Gopinathan

Former Member
0 Kudos

try this...


value="<%= new java.util.Date(System.currentTimeMillis()) %>"

regards

Sebastian

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Please see this weblog. It explains how to do automatic refreshing, but it does so with a date/time stamp. This should show you what you need to do to default the current date on your jsp page.

/people/rich.heilman2/blog/2005/06/07/automatic-refresh-of-dashboard-iviews

Regards,

Rich Heilman