Automatic convert eTCreateDate and eTCreateTime

Document ID : KB000039054
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction:

The attribute eTCreateDate and eTCreateTime contain odd numerical values (see TEC doc TEC524458 for a description of the layout)
Using manual means to “decrypt” the values can be cumbersome
One of our client (Evry) created a powershell script that does this and they have allowed us to share this.

Instructions: 

Use an editor (notepad or your preferred editor) and create the file “get_eT_date_time.ps1”
Copy in the following to the file:

#
# 20160106 v1  Evry
# returns Human readable time date of eTCreateTime and eTCreateDate
# eks: .\get_eT_date_time.ps1 -eTCreateTime 0004107500 -eTCreateDate 0000110013
Param(
    [Parameter(mandatory=$true)][string] $eTCreateTime,
    [Parameter(mandatory=$true)][string] $eTCreateDate
)
 
$day=$eTCreateDate.Remove(0,7).TrimStart("0")
$year=1900+$eTCreateDate.Remove(7).TrimStart("0")
$seconds=$eTCreateTime.TrimStart("0")/100
$ts =  [timespan]::fromseconds($seconds)
$tod="{0:hh:mm:ss}" -f ([datetime]$ts.Ticks)
write-host ([datetime]"01/01/$($year)").AddDays($day-1).ToShortDateString() " $tod"


To run it, use for example

powershell -file get_eT_date_time.ps1 -eTCreateTime 0004107500 -eTCreateDate 0000110013

 

Additional Information:

http://www.ca.com/us/support/ca-support-online/product-content/knowledgebase-articles/tec524458.aspx