Home/Support/Support Forum/How do I use time.strptime() on a ConnectPort X2?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How do I use time.strptime() on a ConnectPort X2?

0 votes
Hi,

I'm currently running into an issue using the time.strptime(str,format) method to parse a string.
Code:
import sys, os import time temp = "2015-02-11 12:56:00" temp = time.strptime(temp, "%Y-%m-%d %H:%M:%S")

When using the method it returns the error:
Code:
Traceback (most recent call last): File "WEB/python/dpdsrv.py", line 14, in ? execfile(os.path.join(os.path.abspath('.'), 'PoP.py')) File "WEB/python/PoP.py", line 28, in ? temp = time.strptime(temp, "%Y-%m-%d %H:%M:%S") ImportError: No module named _strptime

So I then attempted to import _strptime and recieved the following error:
Code:
Traceback (most recent call last): File "WEB/python/dpdsrv.py", line 14, in ? execfile(os.path.join(os.path.abspath('.'), 'PoP.py')) File "WEB/python/PoP.py", line 16, in ? import _strptime File "C:\Python24\lib\_strptime.py", line 269, in ? File "C:\Python24\lib\_strptime.py", line 188, in __init__ File "C:\Python24\lib\_strptime.py", line 77, in __init__ File "C:\Python24\lib\_strptime.py", line 168, in __calc_timezone AttributeError: 'module' object has no attribute 'tzname'

Any tips on how to get this function to work?

Thanks ahead of time!
asked Feb 12, 2015 in Python by dstahulak New to the Community (4 points)

Please log in or register to answer this question.

...