AWS LastModified S3 Bucket different
up vote
1
down vote
favorite
I'm developing a node.js function that lists the objects in an S3 Bucket via the listObjectsV2 call. In the returned json results, the date is not the same as the date shown in the S3 bucket nor in a aws cli s3 list. In fact, they are different days. I'm not sure how this is happening?
Any thoughts?
aws cli ls
aws s3 ls s3://mybucket
2018-11-08 19:38:55 24294 Thought1.mp3
S3 Page on AWS
JSON results
amazon-web-services amazon-s3
add a comment |
up vote
1
down vote
favorite
I'm developing a node.js function that lists the objects in an S3 Bucket via the listObjectsV2 call. In the returned json results, the date is not the same as the date shown in the S3 bucket nor in a aws cli s3 list. In fact, they are different days. I'm not sure how this is happening?
Any thoughts?
aws cli ls
aws s3 ls s3://mybucket
2018-11-08 19:38:55 24294 Thought1.mp3
S3 Page on AWS
JSON results
amazon-web-services amazon-s3
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm developing a node.js function that lists the objects in an S3 Bucket via the listObjectsV2 call. In the returned json results, the date is not the same as the date shown in the S3 bucket nor in a aws cli s3 list. In fact, they are different days. I'm not sure how this is happening?
Any thoughts?
aws cli ls
aws s3 ls s3://mybucket
2018-11-08 19:38:55 24294 Thought1.mp3
S3 Page on AWS
JSON results
amazon-web-services amazon-s3
I'm developing a node.js function that lists the objects in an S3 Bucket via the listObjectsV2 call. In the returned json results, the date is not the same as the date shown in the S3 bucket nor in a aws cli s3 list. In fact, they are different days. I'm not sure how this is happening?
Any thoughts?
aws cli ls
aws s3 ls s3://mybucket
2018-11-08 19:38:55 24294 Thought1.mp3
S3 Page on AWS
JSON results
amazon-web-services amazon-s3
amazon-web-services amazon-s3
edited Nov 9 at 19:55
asked Nov 9 at 19:23
Frank C
85
85
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
They are the same times, but in different timezones.
The listObjectsV2 response is giving you Zulu times (UTC or Greenwich Mean Time), which appears to be 6 hours ahead of you.
Thanks. Appreciate the explanation. Didn't think about time zone issues. Was focused on the different dates. Appreciate the help!
– Frank C
Nov 9 at 20:13
1
Sure. The minutes and seconds being identical (38:55) but the hours being different is always a big clue that it's tz-related.
– jarmod
Nov 9 at 20:15
add a comment |
up vote
1
down vote
In the JSON picture you have 2018-11-09T01:38:55.000Z which is ZULU time (the Z at the very end). It means UTC/GMT time.
In the S3 console picture you have Nov 8, 2018 7:38:55 PM GMT-0600 - this time is GMT time minus 6 hours (see at the end GMT-0600) - which may be possibly the US EST time or similar. The difference between these two is exactly 6 hours.
The output from aws CLI is probably on your local computer and shows local time in the 24H format without the timezone, so it is harder to see the reason, but it matches the S3 console time.
In general, AWS returns times in the UTC time zone. This is usually quite helpful once you start deploying in multiple time-zones. On the other side, it may become tricky if you for example run your code on an EC2 instance where is configured a different timezone. So be careful when you convert from your local time to the UTC time - I would suggest you to even use some library like https://momentjs.com/ or you may create yourself more problems.
Thanks. I've used momentjs before. I'll dig into this a bit more. This is part of an lambda function for an Alexa skill where I play any mp3's that were uploaded in response to a user intent with a date slot. Might get real tricky now that I think about it. I'm guessing alexa when I say anything uploaded today, that will be the local time zone of the alexa issuing the intent. Alot of testing ahead. Thanks again for the response. It is much appreciated!
– Frank C
Nov 9 at 20:17
Let you check the documentation, but internally I would expect that Alexa will use UTC, it will just convert it at the user interface - the same as other services does. So let you try to stick to UTC first. Hope it helps.
– petrch
Nov 9 at 20:26
1
moment did the trick. Thanks again. Thought I would post this link. Difference between the simulator in the alexa dev console and the actual device. forums.developer.amazon.com/questions/60780/…
– Frank C
Nov 9 at 21:23
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
They are the same times, but in different timezones.
The listObjectsV2 response is giving you Zulu times (UTC or Greenwich Mean Time), which appears to be 6 hours ahead of you.
Thanks. Appreciate the explanation. Didn't think about time zone issues. Was focused on the different dates. Appreciate the help!
– Frank C
Nov 9 at 20:13
1
Sure. The minutes and seconds being identical (38:55) but the hours being different is always a big clue that it's tz-related.
– jarmod
Nov 9 at 20:15
add a comment |
up vote
2
down vote
accepted
They are the same times, but in different timezones.
The listObjectsV2 response is giving you Zulu times (UTC or Greenwich Mean Time), which appears to be 6 hours ahead of you.
Thanks. Appreciate the explanation. Didn't think about time zone issues. Was focused on the different dates. Appreciate the help!
– Frank C
Nov 9 at 20:13
1
Sure. The minutes and seconds being identical (38:55) but the hours being different is always a big clue that it's tz-related.
– jarmod
Nov 9 at 20:15
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
They are the same times, but in different timezones.
The listObjectsV2 response is giving you Zulu times (UTC or Greenwich Mean Time), which appears to be 6 hours ahead of you.
They are the same times, but in different timezones.
The listObjectsV2 response is giving you Zulu times (UTC or Greenwich Mean Time), which appears to be 6 hours ahead of you.
answered Nov 9 at 20:01
jarmod
17.7k63845
17.7k63845
Thanks. Appreciate the explanation. Didn't think about time zone issues. Was focused on the different dates. Appreciate the help!
– Frank C
Nov 9 at 20:13
1
Sure. The minutes and seconds being identical (38:55) but the hours being different is always a big clue that it's tz-related.
– jarmod
Nov 9 at 20:15
add a comment |
Thanks. Appreciate the explanation. Didn't think about time zone issues. Was focused on the different dates. Appreciate the help!
– Frank C
Nov 9 at 20:13
1
Sure. The minutes and seconds being identical (38:55) but the hours being different is always a big clue that it's tz-related.
– jarmod
Nov 9 at 20:15
Thanks. Appreciate the explanation. Didn't think about time zone issues. Was focused on the different dates. Appreciate the help!
– Frank C
Nov 9 at 20:13
Thanks. Appreciate the explanation. Didn't think about time zone issues. Was focused on the different dates. Appreciate the help!
– Frank C
Nov 9 at 20:13
1
1
Sure. The minutes and seconds being identical (38:55) but the hours being different is always a big clue that it's tz-related.
– jarmod
Nov 9 at 20:15
Sure. The minutes and seconds being identical (38:55) but the hours being different is always a big clue that it's tz-related.
– jarmod
Nov 9 at 20:15
add a comment |
up vote
1
down vote
In the JSON picture you have 2018-11-09T01:38:55.000Z which is ZULU time (the Z at the very end). It means UTC/GMT time.
In the S3 console picture you have Nov 8, 2018 7:38:55 PM GMT-0600 - this time is GMT time minus 6 hours (see at the end GMT-0600) - which may be possibly the US EST time or similar. The difference between these two is exactly 6 hours.
The output from aws CLI is probably on your local computer and shows local time in the 24H format without the timezone, so it is harder to see the reason, but it matches the S3 console time.
In general, AWS returns times in the UTC time zone. This is usually quite helpful once you start deploying in multiple time-zones. On the other side, it may become tricky if you for example run your code on an EC2 instance where is configured a different timezone. So be careful when you convert from your local time to the UTC time - I would suggest you to even use some library like https://momentjs.com/ or you may create yourself more problems.
Thanks. I've used momentjs before. I'll dig into this a bit more. This is part of an lambda function for an Alexa skill where I play any mp3's that were uploaded in response to a user intent with a date slot. Might get real tricky now that I think about it. I'm guessing alexa when I say anything uploaded today, that will be the local time zone of the alexa issuing the intent. Alot of testing ahead. Thanks again for the response. It is much appreciated!
– Frank C
Nov 9 at 20:17
Let you check the documentation, but internally I would expect that Alexa will use UTC, it will just convert it at the user interface - the same as other services does. So let you try to stick to UTC first. Hope it helps.
– petrch
Nov 9 at 20:26
1
moment did the trick. Thanks again. Thought I would post this link. Difference between the simulator in the alexa dev console and the actual device. forums.developer.amazon.com/questions/60780/…
– Frank C
Nov 9 at 21:23
add a comment |
up vote
1
down vote
In the JSON picture you have 2018-11-09T01:38:55.000Z which is ZULU time (the Z at the very end). It means UTC/GMT time.
In the S3 console picture you have Nov 8, 2018 7:38:55 PM GMT-0600 - this time is GMT time minus 6 hours (see at the end GMT-0600) - which may be possibly the US EST time or similar. The difference between these two is exactly 6 hours.
The output from aws CLI is probably on your local computer and shows local time in the 24H format without the timezone, so it is harder to see the reason, but it matches the S3 console time.
In general, AWS returns times in the UTC time zone. This is usually quite helpful once you start deploying in multiple time-zones. On the other side, it may become tricky if you for example run your code on an EC2 instance where is configured a different timezone. So be careful when you convert from your local time to the UTC time - I would suggest you to even use some library like https://momentjs.com/ or you may create yourself more problems.
Thanks. I've used momentjs before. I'll dig into this a bit more. This is part of an lambda function for an Alexa skill where I play any mp3's that were uploaded in response to a user intent with a date slot. Might get real tricky now that I think about it. I'm guessing alexa when I say anything uploaded today, that will be the local time zone of the alexa issuing the intent. Alot of testing ahead. Thanks again for the response. It is much appreciated!
– Frank C
Nov 9 at 20:17
Let you check the documentation, but internally I would expect that Alexa will use UTC, it will just convert it at the user interface - the same as other services does. So let you try to stick to UTC first. Hope it helps.
– petrch
Nov 9 at 20:26
1
moment did the trick. Thanks again. Thought I would post this link. Difference between the simulator in the alexa dev console and the actual device. forums.developer.amazon.com/questions/60780/…
– Frank C
Nov 9 at 21:23
add a comment |
up vote
1
down vote
up vote
1
down vote
In the JSON picture you have 2018-11-09T01:38:55.000Z which is ZULU time (the Z at the very end). It means UTC/GMT time.
In the S3 console picture you have Nov 8, 2018 7:38:55 PM GMT-0600 - this time is GMT time minus 6 hours (see at the end GMT-0600) - which may be possibly the US EST time or similar. The difference between these two is exactly 6 hours.
The output from aws CLI is probably on your local computer and shows local time in the 24H format without the timezone, so it is harder to see the reason, but it matches the S3 console time.
In general, AWS returns times in the UTC time zone. This is usually quite helpful once you start deploying in multiple time-zones. On the other side, it may become tricky if you for example run your code on an EC2 instance where is configured a different timezone. So be careful when you convert from your local time to the UTC time - I would suggest you to even use some library like https://momentjs.com/ or you may create yourself more problems.
In the JSON picture you have 2018-11-09T01:38:55.000Z which is ZULU time (the Z at the very end). It means UTC/GMT time.
In the S3 console picture you have Nov 8, 2018 7:38:55 PM GMT-0600 - this time is GMT time minus 6 hours (see at the end GMT-0600) - which may be possibly the US EST time or similar. The difference between these two is exactly 6 hours.
The output from aws CLI is probably on your local computer and shows local time in the 24H format without the timezone, so it is harder to see the reason, but it matches the S3 console time.
In general, AWS returns times in the UTC time zone. This is usually quite helpful once you start deploying in multiple time-zones. On the other side, it may become tricky if you for example run your code on an EC2 instance where is configured a different timezone. So be careful when you convert from your local time to the UTC time - I would suggest you to even use some library like https://momentjs.com/ or you may create yourself more problems.
answered Nov 9 at 20:01
petrch
1566
1566
Thanks. I've used momentjs before. I'll dig into this a bit more. This is part of an lambda function for an Alexa skill where I play any mp3's that were uploaded in response to a user intent with a date slot. Might get real tricky now that I think about it. I'm guessing alexa when I say anything uploaded today, that will be the local time zone of the alexa issuing the intent. Alot of testing ahead. Thanks again for the response. It is much appreciated!
– Frank C
Nov 9 at 20:17
Let you check the documentation, but internally I would expect that Alexa will use UTC, it will just convert it at the user interface - the same as other services does. So let you try to stick to UTC first. Hope it helps.
– petrch
Nov 9 at 20:26
1
moment did the trick. Thanks again. Thought I would post this link. Difference between the simulator in the alexa dev console and the actual device. forums.developer.amazon.com/questions/60780/…
– Frank C
Nov 9 at 21:23
add a comment |
Thanks. I've used momentjs before. I'll dig into this a bit more. This is part of an lambda function for an Alexa skill where I play any mp3's that were uploaded in response to a user intent with a date slot. Might get real tricky now that I think about it. I'm guessing alexa when I say anything uploaded today, that will be the local time zone of the alexa issuing the intent. Alot of testing ahead. Thanks again for the response. It is much appreciated!
– Frank C
Nov 9 at 20:17
Let you check the documentation, but internally I would expect that Alexa will use UTC, it will just convert it at the user interface - the same as other services does. So let you try to stick to UTC first. Hope it helps.
– petrch
Nov 9 at 20:26
1
moment did the trick. Thanks again. Thought I would post this link. Difference between the simulator in the alexa dev console and the actual device. forums.developer.amazon.com/questions/60780/…
– Frank C
Nov 9 at 21:23
Thanks. I've used momentjs before. I'll dig into this a bit more. This is part of an lambda function for an Alexa skill where I play any mp3's that were uploaded in response to a user intent with a date slot. Might get real tricky now that I think about it. I'm guessing alexa when I say anything uploaded today, that will be the local time zone of the alexa issuing the intent. Alot of testing ahead. Thanks again for the response. It is much appreciated!
– Frank C
Nov 9 at 20:17
Thanks. I've used momentjs before. I'll dig into this a bit more. This is part of an lambda function for an Alexa skill where I play any mp3's that were uploaded in response to a user intent with a date slot. Might get real tricky now that I think about it. I'm guessing alexa when I say anything uploaded today, that will be the local time zone of the alexa issuing the intent. Alot of testing ahead. Thanks again for the response. It is much appreciated!
– Frank C
Nov 9 at 20:17
Let you check the documentation, but internally I would expect that Alexa will use UTC, it will just convert it at the user interface - the same as other services does. So let you try to stick to UTC first. Hope it helps.
– petrch
Nov 9 at 20:26
Let you check the documentation, but internally I would expect that Alexa will use UTC, it will just convert it at the user interface - the same as other services does. So let you try to stick to UTC first. Hope it helps.
– petrch
Nov 9 at 20:26
1
1
moment did the trick. Thanks again. Thought I would post this link. Difference between the simulator in the alexa dev console and the actual device. forums.developer.amazon.com/questions/60780/…
– Frank C
Nov 9 at 21:23
moment did the trick. Thanks again. Thought I would post this link. Difference between the simulator in the alexa dev console and the actual device. forums.developer.amazon.com/questions/60780/…
– Frank C
Nov 9 at 21:23
add a comment |
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232096%2faws-lastmodified-s3-bucket-different%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown