title: A script to update time
body: <p>So, I have a script that fetches the date and time, but in standard string format. Now, when I set the date via date -s &quot;Feb 11 2021 8:43:00&quot; the shell allows it. But when that same string is attempted to be inserted by my script, it doesn't work and instead throws this error:</p>
  <pre><code>    #!/bin/bash
      # Automatically Updates System Time According to the NIST Atomic Clock in a Linux Environment
      nistTime=$(curl -I --insecure 'https://nist.time.gov/' | grep &quot;Date&quot;)
      echo $nistTime
      dateString=$(echo $nistTime | cut -d' ' -f2-7)
      dayString=$(echo $nistTime | cut -d' ' -f2-2)
      dateValue=$(echo $nistTime | cut -d' ' -f3-3)
      monthValue=$(echo $nistTime | cut -d' ' -f1-1)
      yearValue=$(echo $nistTime | cut -d' ' -f5-5)
      timeValue=$(echo $nistTime | cut -d' ' -f5-5)
      timeZoneValue=$(echo $nistTime | cut -d' ' -f7-7)
      #echo $dateString
      case $monthValue in
          &quot;Jan&quot;)
              monthValue=&quot;01&quot;
              ;;
          &quot;Feb&quot;)
              monthValue=&quot;02&quot;
              ;;
          &quot;Mar&quot;)
              monthValue=&quot;03&quot;
              ;;
          &quot;Apr&quot;)
              monthValue=&quot;04&quot;
              ;;
          &quot;May&quot;)
              monthValue=&quot;05&quot;
              ;;
          &quot;Jun&quot;)
              monthValue=&quot;06&quot;
              ;;
          &quot;Jul&quot;)
              monthValue=&quot;07&quot;
              ;;
          &quot;Aug&quot;)
              monthValue=&quot;08&quot;
              ;;
          &quot;Sep&quot;)
              monthValue=&quot;09&quot;
              ;;
          &quot;Oct&quot;)
              monthValue=&quot;10&quot;
              ;;
          &quot;Nov&quot;)
              monthValue=&quot;11&quot;
              ;;
          &quot;Dec&quot;)
              monthValue=&quot;12&quot;
              ;;
          *)
              continue
      esac;
      sudo date --utc -s $monthValue.$dateValue.$yearValue
  </code></pre>
  <p>Which is triggering said error:</p>
  <pre><code>Date: Thu, 11 Feb 2021 22:04:03 GMT
  ./settime.sh: line 51: continue: only meaningful in a `for', `while', or `until' loop
  date: the argument ‘9:39’ lacks a leading '+';
  when using an option to specify date(s), any non-option
  argument must be a format string beginning with '+'
  Try 'date --help' for more information.
  </code></pre>
  <p>Some insight as to why that is would greatly be appreciated or any way I can automatically update the time from the terminal. Thanks.</p>