cancel
Showing results for 
Search instead for 
Did you mean: 

System Date

Former Member
0 Kudos

Hi,

how to show the current system date in the Input field

Thanks for all ur help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi jayaram,

use the code,

java.sql.Date sqlDate;

java.util.Date tempDate;

tempDate = Calendar.getInstance().getTime() ;

sqlDate = new java.sql.Date(tempDate.getTime());

Create a attribute of type date and set the value of this attribute by sqlDate

as

wdContext.currentContextElement.set<Contextattribute>(sqlDate);

and finally assign this attribute to the inputfield.

Regards,

Saravanan K

Former Member
0 Kudos

Saravanan,

Shorter (and simpler and more efficient) code exists:


java.sql.Date sqlDate = new java.sql.Date(System.currentTimeMillis());

VS

Former Member
0 Kudos

Hi VS,

Thanks for your suggestion. Your code is working great

Regards,

Saravanan K

Answers (0)