Questions tagged [isodate]

Anything related to ISO standard date formats, i.e. a series of ISO-standardized formats for date and time information meant to be "understandable" worldwide, like the following string "2013-10-02 15:35:02".

Anything related to ISO standard date formats, i.e. a series of ISO-standardized formats for date and time information meant to be "understandable" worldwide.

For example, the following string "2013-10-02 15:35:02" represents the following time in ISO format:

   year: 2013
  month: 10
    day: 2
   hour: 15 
minutes: 35
seconds: 2
240 questions
239
votes
11 answers

Date query with ISODate in mongodb doesn't seem to work

I don't seem to be able to get even the most basic date query to work in MongoDB. With a document that looks something like this: { "_id" : "foobar/201310", "ap" : "foobar", "dt" : ISODate("2013-10-01T00:00:00.000Z"), "tl" :…
Jason Polites
  • 5,571
  • 3
  • 25
  • 24
140
votes
10 answers

convert iso date to milliseconds in javascript

Can I convert iso date to milliseconds? for example I want to convert this iso 2012-02-10T13:19:11+0000 to milliseconds. Because I want to compare current date from the created date. And created date is an iso date.
Robin Carlo Catacutan
  • 13,249
  • 11
  • 52
  • 85
72
votes
4 answers

MongoDB + nodejs : how to query ISODate fields?

I am using nodejs with the node-mongodb-native driver (http://mongodb.github.io/node-mongodb-native/). I have documents with a date property stored as ISODate type. Through nodejs, I am using this query: db.collection("log").find({ localHitDate:…
Fred Mériot
  • 4,157
  • 9
  • 33
  • 50
69
votes
13 answers

Remove Seconds/ Milliseconds from Date convert to ISO String

I have a date object that I want to remove the miliseconds/or set to 0 remove the seconds/or set to 0 Convert to ISO string For example: var date = new Date(); //Wed Mar 02 2016 16:54:13 GMT-0500 (EST) var stringDate =…
tester123
  • 1,033
  • 2
  • 12
  • 17
41
votes
5 answers

Create an ISODate with pyMongo

I've been trying to find a way to create an ISODate object whith pyMongo client, but without any success so far. I use http://pypi.python.org/pypi/pymongo3 client, which is the only serious one available in Python 3 for now, but the problem doesn't…
Guillaume Lebourgeois
  • 3,796
  • 1
  • 20
  • 23
36
votes
4 answers

Formatting ISODate from Mongodb

In Mongodb I am storing date and time in ISODate format. Which looks like this ISODate("2012-07-14T01:00:00+01:00") Using nodejs/javascript, how can I display the time component so I would get something like this Time : 01:00 I am using momentjs…
jamjam
  • 3,171
  • 7
  • 34
  • 39
17
votes
7 answers

Get date ISO string without conversion to UTC timezone

Is there a way in JavaScript to obtain an ISO string of a new Date object: while maintaining the original local timezone (i.e. not converting to UTC) with time component set to midnight without resorting to manually rebuilding a new Date via…
Maximus Decimus
  • 4,901
  • 22
  • 67
  • 95
17
votes
1 answer

How to format date displayed in Datatable

I have a function that displays objects in my array using datatables. I'm a bit a problem with changing the date and time format from ISODate to human readable format. myData var datas = {“rows” : [{_id: "2017-01-03T00:00:00.000Z", Humidity: 24,…
Ekom
  • 599
  • 3
  • 8
  • 24
16
votes
6 answers

Mongoexport -q ISODate query

I'm trying to run this: mongoexport.exe -h *MYHOST* -p *MYPORT* -q "{'time':{'$gte': ISODate('2014-12-21 12:57:00.506Z'),'$lt': ISODate('2014-12-21 12:59:00.506Z')}}" Or this(the gte & lt without - ' ): mongoexport.exe -h *MYHOST* -p *MYPORT* -q…
user_s
  • 1,058
  • 2
  • 12
  • 35
16
votes
3 answers

Storing Utc and Local datetime in Mongo

I have a Mongo C# implementation that stores datetime as UTC. MongoDB.Bson.Serialization.Options.DateTimeSerializationOptions options = MongoDB.Bson.Serialization.Options.DateTimeSerializationOptions.UtcInstance; var serializer = new…
LIFE REFACTORED
  • 235
  • 1
  • 3
  • 6
14
votes
4 answers

How to return ISO date format in PHP for MongoDB?

I want to store the current date generated from PHP into MongoDB collection as an ISO date formate. ISODate("2012-11-02T08:40:12.569Z") However I am not able to generate such Kind of date in php which will be stored in MongoDB as an ISODate…
user1518659
  • 2,198
  • 9
  • 29
  • 40
12
votes
2 answers

new Date() in wrong time zone

At the time of this post my current time is 2017-01-10T19:23:00.000Z but new Date() gives me 2017-01-11T00:23:19.521Z 5 hours ahead of my current timezone. This affects the way my data is stored in my MongoDB. I know I can set the time to 5 hours…
Ekom
  • 599
  • 3
  • 8
  • 24
12
votes
0 answers

camel-mongodb save java.util.Date as ISODate instead of NumberLong

I'm using Apache Camel 2.13.1 and MongoDB 2.2.2. I have the following route:
allancth
  • 300
  • 3
  • 15
11
votes
5 answers

Modifying an ISO Date in Javascript

I'm creating several ISO dates in a Javascript program with the following command: var isodate = new Date().toISOString() which returns dates in the format of "2014-05-15T16:55:56.730Z". I need to subtract 5 hours from each of these dates. The above…
Anconia
  • 3,888
  • 6
  • 36
  • 65
11
votes
1 answer

Get component of Date / ISODate in mongo

How to get a component like minute from ISODate stored in MongoCollection?
Saint
  • 5,397
  • 22
  • 63
  • 107
1
2 3
15 16