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

**URL:** <https://forums.digi.com/t/how-do-i-use-time-strptime-on-a-connectport-x2/14349>\
**Category:** Python\
**Tags:** connectport-x2, time, python, x2, connectport\
**Created:** [February 12, 2015, 9:49am UTC](https://forums.digi.com/t/how-do-i-use-time-strptime-on-a-connectport-x2/14349 "2015-02-12T09:49:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dstahulak](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@dstahulak](https://forums.digi.com/u/dstahulak)\
**Post date:** [February 12, 2015, 9:49am UTC](https://forums.digi.com/t/how-do-i-use-time-strptime-on-a-connectport-x2/14349/1 "2015-02-12T09:49:39Z")

</div>

Hi,

I’m currently running into an issue using the time.strptime(str,format) method to parse a string.

```auto
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:

```auto
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:

```auto
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!
