cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the system date

Former Member
0 Kudos

Hi all,

Please let me know how to get the current date?

Regards

DK

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello DK,

Use this code inside your program.

java.util.Date tempDate = Calendar.getInstance().

getTime();

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

this.wdContext.currentContextElement().

setStartDate(sqlDate);

Hope this resolves to get the current system date.

Regards,

Venkat

Former Member
0 Kudos

guys, just curious: do you differenciate system date/time (on the server) and client date/time which in general are not the same?!

Former Member
0 Kudos

Hi

Date date1 = new Date();

SimpleDateFormat fmtDatePlain = new SimpleDateFormat("yyyyMMdd");

String formattedDate = fmtDatePlain.format(date1);

System.out.println("todaysdate" +formattedDate);

Thanks

Lohi.