presiannedyalkov
8/21/2019 - 8:42 AM

Add date+time stamp

Add Date+Time to field in Commerce Cloud.

const Calendar = require('dw/util/Calendar');
const StringUtils = require('dw/util/StringUtils');
const DATETIME_FORMAT = 'yyyy-MM-dd_HH-mm-ss-SSS';
const calendar = new Calendar();
const datetime = StringUtils.formatCalendar(calendar, DATETIME_FORMAT);