Q:

How to get current date (date only format) in java and save it in a Notes document

How can I define a date field that contains only the date, and how can I save it back to a Notes document?
I tried:
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
Date date = new Date();
doc.replaceItemValue("employee_Created", dateFormat.format(date));

but then I save the value in text format and that is not want I want.

A:

Use DateTime's setAnyTime(). It removes the time part:
DateTime dateTime = session.createDateTime(new Date());
dateTime.setAnyTime();
doc.replaceItemValue("employee_Created", dateTime);

The resulting item "employee_Created" is just a date without a time:

