ValueError: time data '1520-18-12 00:00:00.000000' does not match format '%Y-%m-%d %H:%M:%S.%f' in robot...











up vote
0
down vote

favorite












I am trying to convert May 15 2018 12:00 AM to 05 15 2018 12:00. But during the conversion process, I am getting the following error message:




ValueError: time data '1520-18-12 00:00:00.000000' does not match
format '%Y-%m-%d %H:%M:%S.%f'




${converted_date}=  Convert date  May 15 2018 12:00 AM  %m %d %Y %H:%M









share|improve this question




























    up vote
    0
    down vote

    favorite












    I am trying to convert May 15 2018 12:00 AM to 05 15 2018 12:00. But during the conversion process, I am getting the following error message:




    ValueError: time data '1520-18-12 00:00:00.000000' does not match
    format '%Y-%m-%d %H:%M:%S.%f'




    ${converted_date}=  Convert date  May 15 2018 12:00 AM  %m %d %Y %H:%M









    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am trying to convert May 15 2018 12:00 AM to 05 15 2018 12:00. But during the conversion process, I am getting the following error message:




      ValueError: time data '1520-18-12 00:00:00.000000' does not match
      format '%Y-%m-%d %H:%M:%S.%f'




      ${converted_date}=  Convert date  May 15 2018 12:00 AM  %m %d %Y %H:%M









      share|improve this question















      I am trying to convert May 15 2018 12:00 AM to 05 15 2018 12:00. But during the conversion process, I am getting the following error message:




      ValueError: time data '1520-18-12 00:00:00.000000' does not match
      format '%Y-%m-%d %H:%M:%S.%f'




      ${converted_date}=  Convert date  May 15 2018 12:00 AM  %m %d %Y %H:%M






      robotframework






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 7 at 9:08









      grrigore

      568420




      568420










      asked Nov 7 at 9:05









      Poovin

      286




      286
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Looks like you have to explicitly provide the format of the the source date, as the keyword did not succeed to automatically deduct it.

          The problem is most probably with the beginning of the string, the "May" word in it. In time formatting directives this is %b; so this should do it:



          ${converted_date}=  Convert date  May 15 2018 12:00 AM  result_format=%m %d %Y %H:%M  date_format=%b %d %Y %H:%M


          It's a bit hard to say from just this example is it %b - the 3 letterer abbreviated version of the month, or %B - the full name, as May is the only month that the 2 are the same :).



          Here's a reference of python's time formatting directives - http://strftime.org.






          share|improve this answer























          • On executing the above script, I'm getting this error: ValueError: unconverted data remains: AM
            – Poovin
            Nov 7 at 10:08








          • 1




            ${converted_date}= Convert date May 15 2018 12:00 AM result_format=%m %d %Y %H:%M date_format=%b %d %Y %H:%M %p resolved the ValueError: unconverted data remains: AM
            – Poovin
            Nov 7 at 11:13













          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%2f53186308%2fvalueerror-time-data-1520-18-12-000000-000000-does-not-match-format-y-m%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          Looks like you have to explicitly provide the format of the the source date, as the keyword did not succeed to automatically deduct it.

          The problem is most probably with the beginning of the string, the "May" word in it. In time formatting directives this is %b; so this should do it:



          ${converted_date}=  Convert date  May 15 2018 12:00 AM  result_format=%m %d %Y %H:%M  date_format=%b %d %Y %H:%M


          It's a bit hard to say from just this example is it %b - the 3 letterer abbreviated version of the month, or %B - the full name, as May is the only month that the 2 are the same :).



          Here's a reference of python's time formatting directives - http://strftime.org.






          share|improve this answer























          • On executing the above script, I'm getting this error: ValueError: unconverted data remains: AM
            – Poovin
            Nov 7 at 10:08








          • 1




            ${converted_date}= Convert date May 15 2018 12:00 AM result_format=%m %d %Y %H:%M date_format=%b %d %Y %H:%M %p resolved the ValueError: unconverted data remains: AM
            – Poovin
            Nov 7 at 11:13

















          up vote
          2
          down vote



          accepted










          Looks like you have to explicitly provide the format of the the source date, as the keyword did not succeed to automatically deduct it.

          The problem is most probably with the beginning of the string, the "May" word in it. In time formatting directives this is %b; so this should do it:



          ${converted_date}=  Convert date  May 15 2018 12:00 AM  result_format=%m %d %Y %H:%M  date_format=%b %d %Y %H:%M


          It's a bit hard to say from just this example is it %b - the 3 letterer abbreviated version of the month, or %B - the full name, as May is the only month that the 2 are the same :).



          Here's a reference of python's time formatting directives - http://strftime.org.






          share|improve this answer























          • On executing the above script, I'm getting this error: ValueError: unconverted data remains: AM
            – Poovin
            Nov 7 at 10:08








          • 1




            ${converted_date}= Convert date May 15 2018 12:00 AM result_format=%m %d %Y %H:%M date_format=%b %d %Y %H:%M %p resolved the ValueError: unconverted data remains: AM
            – Poovin
            Nov 7 at 11:13















          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          Looks like you have to explicitly provide the format of the the source date, as the keyword did not succeed to automatically deduct it.

          The problem is most probably with the beginning of the string, the "May" word in it. In time formatting directives this is %b; so this should do it:



          ${converted_date}=  Convert date  May 15 2018 12:00 AM  result_format=%m %d %Y %H:%M  date_format=%b %d %Y %H:%M


          It's a bit hard to say from just this example is it %b - the 3 letterer abbreviated version of the month, or %B - the full name, as May is the only month that the 2 are the same :).



          Here's a reference of python's time formatting directives - http://strftime.org.






          share|improve this answer














          Looks like you have to explicitly provide the format of the the source date, as the keyword did not succeed to automatically deduct it.

          The problem is most probably with the beginning of the string, the "May" word in it. In time formatting directives this is %b; so this should do it:



          ${converted_date}=  Convert date  May 15 2018 12:00 AM  result_format=%m %d %Y %H:%M  date_format=%b %d %Y %H:%M


          It's a bit hard to say from just this example is it %b - the 3 letterer abbreviated version of the month, or %B - the full name, as May is the only month that the 2 are the same :).



          Here's a reference of python's time formatting directives - http://strftime.org.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 7 at 9:53

























          answered Nov 7 at 9:44









          Todor

          4,8282033




          4,8282033












          • On executing the above script, I'm getting this error: ValueError: unconverted data remains: AM
            – Poovin
            Nov 7 at 10:08








          • 1




            ${converted_date}= Convert date May 15 2018 12:00 AM result_format=%m %d %Y %H:%M date_format=%b %d %Y %H:%M %p resolved the ValueError: unconverted data remains: AM
            – Poovin
            Nov 7 at 11:13




















          • On executing the above script, I'm getting this error: ValueError: unconverted data remains: AM
            – Poovin
            Nov 7 at 10:08








          • 1




            ${converted_date}= Convert date May 15 2018 12:00 AM result_format=%m %d %Y %H:%M date_format=%b %d %Y %H:%M %p resolved the ValueError: unconverted data remains: AM
            – Poovin
            Nov 7 at 11:13


















          On executing the above script, I'm getting this error: ValueError: unconverted data remains: AM
          – Poovin
          Nov 7 at 10:08






          On executing the above script, I'm getting this error: ValueError: unconverted data remains: AM
          – Poovin
          Nov 7 at 10:08






          1




          1




          ${converted_date}= Convert date May 15 2018 12:00 AM result_format=%m %d %Y %H:%M date_format=%b %d %Y %H:%M %p resolved the ValueError: unconverted data remains: AM
          – Poovin
          Nov 7 at 11:13






          ${converted_date}= Convert date May 15 2018 12:00 AM result_format=%m %d %Y %H:%M date_format=%b %d %Y %H:%M %p resolved the ValueError: unconverted data remains: AM
          – Poovin
          Nov 7 at 11:13




















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53186308%2fvalueerror-time-data-1520-18-12-000000-000000-does-not-match-format-y-m%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







          這個網誌中的熱門文章

          Xamarin.form Move up view when keyboard appear

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Anylogic : not able to use stopDelay()