isodate

Mongoexport -q ISODate query

北城以北 提交于 2019-11-30 03:52:03
问题 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 {'time':{$gte: ISODate('2014-12-21 12:57:00.506Z'),$lt: ISODate('2014-12-21 12:59:00.506Z')}} The query works fine on Robomongo, But with mongoexport it throws: "too many positional arguments" I know I can run the following instead, But I don't want

Oracle SQL query statement and conditions with timestamps and ISO dates

回眸只為那壹抹淺笑 提交于 2019-11-29 16:25:20
I need a query which will select records from Oracle database on the basis of the datetime condition. Example below: SELECT * FROM table_name WHERE [modification_date] >= '2014-01-28T12:00:00Z'; As datetime I used ISO date and this is "Must be". In Oracle XE database a [modification_date] column has type "Timestamp with time zone". And now is my question - How to convert ISO date in query to proper searching on database ? I tried adding to_timestamp_tz to query statement. SELECT * FROM table_name WHERE MODIFICATION_DATE >= to_timestamp_tz('2014-01-28T00:00:0Z', 'YYYY-MM-DD"T"HH24:MI:SS'); But

How to format date displayed in Datatable

落爺英雄遲暮 提交于 2019-11-29 13:59:50
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, Temperature: 18}, {_id: "2017-01-04T00:00:00.000Z", Humidity: 23.071428571428573, Temperature: 18.928571428571427} ]} JS script var table = $('#myTable').DataTable( { data: datas.rows, "columns": [ { data: "_id" }, { data: "Temperature" }, { data: "Humidity" } ] }); Thanks for your anticipated help. As noted by @Paul Abbott above, momentjs and a render

Oracle SQL query statement and conditions with timestamps and ISO dates

自作多情 提交于 2019-11-28 10:55:05
问题 I need a query which will select records from Oracle database on the basis of the datetime condition. Example below: SELECT * FROM table_name WHERE [modification_date] >= '2014-01-28T12:00:00Z'; As datetime I used ISO date and this is "Must be". In Oracle XE database a [modification_date] column has type "Timestamp with time zone". And now is my question - How to convert ISO date in query to proper searching on database ? I tried adding to_timestamp_tz to query statement. SELECT * FROM table

How to format date displayed in Datatable

眉间皱痕 提交于 2019-11-28 07:38:43
问题 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, Temperature: 18}, {_id: "2017-01-04T00:00:00.000Z", Humidity: 23.071428571428573, Temperature: 18.928571428571427} ]} JS script var table = $('#myTable').DataTable( { data: datas.rows, "columns": [ { data: "_id" }, { data: "Temperature" }, { data:

MongoDB + nodejs : how to query ISODate fields?

心不动则不痛 提交于 2019-11-27 21:47:24
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: { '$gte': '2013-12-12T16:00:00.000Z', '$lt': '2013-12-12T18:00:00.000Z' } }) It returns nothing. To make it work I need to do the following instead: db.collection("log").find({ localHitDate: { '$gte': ISODate('2013-12-12T16:00:00.000Z'), '$lt': ISODate('2013-12-12T18:00:00.000Z') } }) But ISODate is not recognized in my nodejs code. So how can I make

Storing Utc and Local datetime in Mongo

我是研究僧i 提交于 2019-11-27 20:15:56
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 MongoDB.Bson.Serialization.Serializers.DateTimeSerializer(options); MongoDB.Bson.Serialization.BsonSerializer.RegisterSerializer( typeof(DateTime), serializer); I also have a need to store the user local timezone along with the UTC. To explain, I have two properties that goes like DateTime WorkItemToCompleteBy{get; set;} [BsonDateTimeOptions(Kind = DateTimeKind

Create an ISODate with pyMongo

自古美人都是妖i 提交于 2019-11-27 07:26:20
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 seem to come from this specific pymongo version. I'd like to know if any of you has found a solution to use this MongoDB object type from a pymongo client... thanks for your help ! You just need to store an instance of datetime.datetime. Inserting from the python shell: >>> c.test.test.insert({'date': datetime.datetime.utcnow()}) ObjectId(

Formatting ISODate from Mongodb

给你一囗甜甜゛ 提交于 2019-11-27 06:54:38
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 to make this easier but from what I can tell momentjs does seem to support the ISODate format. Thanks for you help. JavaScript's Date object supports the ISO date format, so as long as you have access to the date string, you can do something like this: > foo = new Date("2012-07-14T01:00:00+01:00") Sat, 14 Jul 2012 00:00:00 GMT > foo.toTimeString() '17

convert iso date to milliseconds in javascript

萝らか妹 提交于 2019-11-27 03:31:22
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. Try this var date = new Date("11/21/1987 16:00:00"); // some mock date var milliseconds = date.getTime(); // This will return you the number of milliseconds // elapsed from January 1, 1970 // if your date is less than that date, the value will be negative EDIT You've provided an ISO date. It is also accepted by the constructor of the Date object var myDate = new Date("2012-02-10T13