خرید بک لینک

Vote count: 0

I have a mongodb collection storing the date as :

ISODate("2016-04-18T22:00:00.000Z")

using robomongo, I try to get a record with that date as follows :

$date : {
    $eq : new Date("2016-04-18T22:00:00.000Z")
}

This fails since the timezones are off. The created record was in Central Time, the client machine that sends the requested date is on East Coast Time.

I really dont need to know the time zone as the time zone info is irrelevant to my use cases.

Is there something I can do with the date contructor for this.

I tried :

$eq: new Date(new Date(the date).getTime() + (new    Date().getTimezoneOffset() * 60 * 1000))

Which retus the CST local Time which is an hour off still.

As mentioned, I would rather avoid timezones altogether.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 16 ارديبهشت 1395 ساعت: 7:41

صفحه بندی