time loop error

hello
i’m using the time loop example from the digi micropython guide in Xbee3 Zigbee as below :

import time
print("
Preparing to print the current time 5 times, once every 5 seconds.")
print("The time format is (year, month, day, hour, second, day, yearday)
")
for _ in range(5): # Loop 5 times.
print(time.localtime()) # Print out the current time.
print(“Pause 5 seconds”)
time.sleep(5)
print(“Done!”)

but i’m getting the below error :
Traceback (most recent call last):
File “”, line 5, in
AttributeError: ‘module’ object has no attribute ‘localtime’

any help ?
thank you

This needs to be uploaded, compiled and run on an XBee 3 cellular module. It should be done using PyCharm so that the proper components can be added.