diff --git a/tools/pyboard.py b/tools/pyboard.py
index d5b3237cabada2af1eb2421f59a6ef5fc2ed7a31..a44710914e4951339192288fa77f6192dfaf157e 100644
--- a/tools/pyboard.py
+++ b/tools/pyboard.py
@@ -89,8 +89,8 @@ class Pyboard:
         return self.exec(pyfile)
 
     def get_time(self):
-        t = str(self.exec('pyb.time()'), encoding='ascii').strip().split()[1].split(':')
-        return int(t[0]) * 3600 + int(t[1]) * 60 + int(t[2])
+        t = str(self.eval('pyb.RTC().datetime()'), encoding='ascii')[1:-1].split(', ')
+        return int(t[4]) * 3600 + int(t[5]) * 60 + int(t[6])
 
 def execfile(filename, device='/dev/ttyACM0'):
     pyb = Pyboard(device)