expiration: moment().add(aliyun.expiration, 'hours').toISOString(), conditions: [ { bucket: aliyun.bucket },
expiration: moment().add(aliyun.expiration, 'hours').toISOString(), conditions: [ { bucket: aliyun.bucket },
export function convertDateToShiftedISOString(date, shiftTimestamp) { return moment(date) .add(shiftTimestamp, 'ms') .utc() .toISOString(); }
export function convertUTCDateToShiftedLocalISOString(date, shiftTimestamp) { const user = { ...store.getState().userReducer.user }; const { timezoneOffset } = user; return moment(date) .subtract(timezoneOffset) .add(shiftTimestamp, 'ms') .utc() .toISOString(); }
bookingRouter.get('/:id/:date', isAuthed, (req, res) => { let query = { roomId: req.params.id, date: {$gte: req.params.date, $lt: moment(req.params.date).add(1, 'day').toISOString() } }; booking.find(query, (err, bookings) => { if(err) res.status(500).send(err); if(!bookings) res.status(404).send('Booking not found.'); res.status(200).json(bookings); }); });
$(element).on('shown', function(e, editable) { var element = editable.input.$input['0']; $(element).datetimepicker(config); element.onblur = function(){ $(element).datetimepicker("destroy"); } element.onfocus = function(){ $(element).datetimepicker('show'); } element.onchange = function(){ value(moment(element.value, config.format).toISOString()); }; });
var utcDate = function(){ return new Date( moment().toISOString() ); }
Meteor.publish('sentEmailsInfo', function() { if (!this.userId) return []; const now = new Date(); const yesterday = moment().subtract(1, "days").toISOString(); return SendInformation.find({ userId: this.userId, sentAt: { $gte: yesterday, $lt: now } }); });
app.get("/api/expected-date/:invoiceId", (req, res) => { const invoiceId = parseInt(req.params.invoiceId) // ¯\_(ツ)_/¯ const bump = Math.floor(Math.random() * 10) + 1 const expectedDate = moment().add(bump, 'days').toISOString() res.json({ invoiceId, expectedDate }) })
test('timezone is set to Europe/Amsterdam', () => { // this test file is written to expect the timezone to be Europe/Amsterdam as the developers machine is configured like that expect( moment('2018-01-01 01:00:00').toISOString() ).toBe( new Date('2018-01-01').toISOString() ) })
trending(queryOpts = {}) { const { filter } = queryOpts; const timeAndSourceFilter = `crawl_date>${moment().subtract(24,'h').toISOString().slice(0, -5)}`; const params = Object.assign({ environment_id: this.environment_id, collection_id: this.collection_id, return: 'enriched_title.entities.text', aggregation: aggregations.trending }, queryOpts, { filter: filter ? `${filter},${timeAndSourceFilter}` : timeAndSourceFilter }); console.log('Discovery Trending Query Params: '); console.log(util.inspect(params, false, null)); return params; }
static getNow() { return moment().toISOString(true) }
// plain text passcode length //------------------------------------------------------------------------------ // AUX FUNCTIONS: //------------------------------------------------------------------------------ const getExpDate = () => ( // Five minutes from now moment().add(5, 'minutes').toISOString() // moment().add(5, 'seconds').toISOString() )
export function convertUTCDateToLocalISOString(date) { const user = { ...store.getState().userReducer.user }; const { timezoneOffset } = user; return moment(date) .subtract(timezoneOffset) .utc() .toISOString(); }
export function convertDateToISOString(date) { return moment(date) .utc() .toISOString(); }