function inFiveMinutes() { var dateOne = new Date() dateOne.setTime(dateOne.getTime() + (1000 * 60 * 5)) // add 5 minutes return dateOne.toUTCString() }
const getDateTimeInfo = () => { return { now: Date.now(), iso: new Date().toISOString(), utc: new Date().toUTCString() }; }
expect(serialize(date)).toBe(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);
// 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 cache-control headers cache(maxAge,isPrivate=false) { // if custom string value if (maxAge !== true && maxAge !== undefined && typeof maxAge === 'string') { this.header('Cache-Control', maxAge) } else if (maxAge === false) { this.header('Cache-Control', 'no-cache, no-store, must-revalidate') } else { maxAge = maxAge && !isNaN(maxAge) ? (maxAge/1000|0) : 0 this.header('Cache-Control', (isPrivate === true ? 'private, ' : '') + 'max-age=' + maxAge) this.header('Expires',new Date(Date.now() + maxAge).toUTCString()) } return this }
function showLegalWarning() { console.log(new Date().toUTCString()); console.log('********************************************************************************'); console.log('You are installing the Node Application Metrics monitoring and profiling module.'); console.log('Licensed under the Apache License, Version 2.0 (the "License")'); console.log('you may not use this file except in compliance with the License.'); console.log('You may obtain a copy of the License at'); console.log(''); console.log('http://www.apache.org/licenses/LICENSE-2.0'); console.log(''); console.log('Unless required by applicable law or agreed to in writing, software'); console.log('distributed under the License is distributed on an "AS IS" BASIS,'); console.log('WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.'); console.log('See the License for the specific language governing permissions and'); console.log('limitations under the License.'); console.log('********************************************************************************'); }
describe('s3cmd getService', () => { it("should get a list of a user's buckets", done => { checkRawOutput(['ls'], 's3://', `${bucket}`, 'stdout', foundIt => { assert(foundIt); done(); }); }); it("should have response headers matching AWS's response headers", done => { provideLineOfInterest(['ls', '--debug'], 'DEBUG: Response: {', parsedObject => { assert(parsedObject.headers['x-amz-id-2']); assert(parsedObject.headers['transfer-encoding']); assert(parsedObject.headers['x-amz-request-id']); const gmtDate = new Date(parsedObject.headers.date) .toUTCString(); assert.strictEqual(parsedObject.headers.date, gmtDate); assert.strictEqual(parsedObject .headers['content-type'], 'application/xml'); assert.strictEqual(parsedObject .headers['set-cookie'], undefined); done(); }); }); });
require('../index')({ version: 'v1.0', logger: { timestamp: () => new Date().toUTCString() } })
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);