Save mongo ISO string as date object
up vote
0
down vote
favorite
, I have a timestamp and I converted it to isoString(UTC)
new Date(parseInt(timestamp)*1000).toISOString()
but this returns a string
I would like to save always date object in MONGO but in UTC
new date() is the local date of my local machine.
How can I keep UTC from each machine
mongodb
add a comment |
up vote
0
down vote
favorite
, I have a timestamp and I converted it to isoString(UTC)
new Date(parseInt(timestamp)*1000).toISOString()
but this returns a string
I would like to save always date object in MONGO but in UTC
new date() is the local date of my local machine.
How can I keep UTC from each machine
mongodb
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
, I have a timestamp and I converted it to isoString(UTC)
new Date(parseInt(timestamp)*1000).toISOString()
but this returns a string
I would like to save always date object in MONGO but in UTC
new date() is the local date of my local machine.
How can I keep UTC from each machine
mongodb
, I have a timestamp and I converted it to isoString(UTC)
new Date(parseInt(timestamp)*1000).toISOString()
but this returns a string
I would like to save always date object in MONGO but in UTC
new date() is the local date of my local machine.
How can I keep UTC from each machine
mongodb
mongodb
asked Nov 8 at 8:28
Tuz
164111
164111
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203901%2fsave-mongo-iso-string-as-date-object%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password