const getDateTimeInfo = () => { return { now: Date.now(), iso: new Date().toISOString(), utc: new Date().toUTCString() }; }
const serializeDateIso = value => { if (typeof value === 'string') { return value; } if (value instanceof Date) { return value.toUTCString(); } throw new TypeValidationError(value, 'Date'); }
function inFiveMinutes() { var dateOne = new Date() dateOne.setTime(dateOne.getTime() + (1000 * 60 * 5)) // add 5 minutes return dateOne.toUTCString() }
expect(serialize(date)).toBe(date.toUTCString()); });
function getCurrentDateTimeAsString() { return (new Date()).toUTCString() }
if (typeof opt.expires.toUTCString === 'function') { expires = opt.expires.toUTCString() } else { const dateExpires = new Date(opt.expires) expires = dateExpires.toUTCString()
body: { id: activity.id, timestamp: new Date().toUTCString(), }, }); resolve({ status: 200, body: { id: result.id, timestamp: new Date().toUTCString() }, }); }); resolve({ status: 200, body: { id: result.id, timestamp: new Date().toUTCString() }, });
base = ' ' + Date.prototype.toUTCString.call(value);
errors: stats.failures, skipped: stats.tests - stats.failures - stats.passes, timestamp: new Date().toUTCString(), time: stats.duration / 1000 || 0, },
// end it it('Permanent Cookie (set maxAge)', async function() { let _event = Object.assign({},event,{ path: '/cookieMaxAge' }) let result = await new Promise(r => api.run(_event,{},(e,res) => { r(res) })) expect(result).to.deep.equal({ multiValueHeaders: { 'content-type': ['application/json'], 'set-cookie': ['test=value; MaxAge=3600; Expires='+ new Date(Date.now()+3600000).toUTCString() + '; Path=/'] }, statusCode: 200, body: '{}', isBase64Encoded: false }) })
// Add last-modified headers modified(date) { if (date !== false) { let lastModified = date && typeof date.toUTCString === 'function' ? date : date && Date.parse(date) ? new Date(date) : new Date() this.header('Last-Modified', lastModified.toUTCString()) } return this }
function fiveMinutesAgo() { var dateOne = new Date() dateOne.setTime(dateOne.getTime() - (1000 * 60 * 5)) // add 5 minutes return dateOne.toUTCString() }
base = ' ' + Date.prototype.toUTCString.call(value);
base = ' ' + Date.prototype.toUTCString.call(value);
base = ' ' + Date.prototype.toUTCString.call( value );