title: get system uptime with Python on a Raspberry Pi
body: <p>This question refers to:
  <a href="https://stackoverflow.com/questions/42471475/fastest-way-to-get-system-uptime-in-python-in-linux/64622707#64622707">uptime with Python</a></p>
  <p>If I use the programm on a raspberry, I get the wrong time:</p>
  <pre><code>~ $ uname -a
  Linux raspberry 5.4.72-v7+ #1356 SMP Thu Oct 22 13:56:54 BST 2020 armv7l GNU/Linux
  
  
  pi@raspberry:~ $ uptime
  15:14:33 up 20 min,  3 users,  load average: 0,00, 0,08, 0,09
  </code></pre>
  <p>But the output is:</p>
  <pre><code>20 0 1 # days, hours, minutes
  </code></pre>
  <p>I'm using:</p>
  <pre><code>import subprocess 
  def uptime1(): # liefert Zeit in s
      raw = subprocess.check_output('uptime').decode(&quot;utf8&quot;).replace(',', '')
      days = int(raw.split()[2])
      if 'min' in raw:
          hours = 0
          minutes = int(raw[4])
      else:
          hours, minutes = map(int,raw.split()[4].split(':'))
      print(days, hours, minutes)    
      totalsecs = ((days * 24 + hours) * 60 + minutes) * 60
      return totalsecs
  
  zeit=uptime1()
  </code></pre>
  <p>How can that be solved?</p>