wer.helpers

class wer.helpers.DateField(xpath)[source]

Custom date field

Uses the custom date mapper

class wer.helpers.DateMapper(format=None, normalize=False)[source]

Custom mapper for WER date

Converts XML timestamp to python datetime.datetime

to_python(node)[source]

Converts internal Windows timestamp to Python datetime.datetime

Parameters:node (basestring) – XML node value
Returns:Python datetime
Return type:datetime.datetime
to_xml(dt)[source]

Converts Windows timestamp

Parameters:dt – date and time to convert
Returns:Windows timestamp
Return type:int
wer.helpers.unix_to_windows_timestamp(unix_timestamp)[source]

Converts a Windows timestamp to Unix one

Parameters:unix_timestamp (int) – Unix timestamp
Returns:Windows timestamp
Return type:int
wer.helpers.windows_to_unix_timestamp(windows_timestamp)[source]

Converts a Windows timestamp to Unix one

Parameters:windows_timestamp (int) – Windows timestamp
Returns:Unix timestamp
Return type:int