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



enter image description here



JSON results



enter image description here










share|improve this question



























    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



    enter image description here



    JSON results



    enter image description here










    share|improve this question

























      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



      enter image description here



      JSON results



      enter image description here










      share|improve this question















      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



      enter image description here



      JSON results



      enter image description here







      amazon-web-services amazon-s3






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 9 at 19:55

























      asked Nov 9 at 19:23









      Frank C

      85




      85






















          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.






          share|improve this answer




















          • 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

















          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.






          share|improve this answer




















          • 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











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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

























          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.






          share|improve this answer




















          • 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














          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.






          share|improve this answer




















          • 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












          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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
















          • 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












          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.






          share|improve this answer




















          • 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















          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.






          share|improve this answer




















          • 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













          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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


















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo