Automatic convert eTCreateDate and eTCreateTime
search cancel

Automatic convert eTCreateDate and eTCreateTime

book

Article ID: 39054

calendar_today

Updated On:

Products

CA Identity Manager CA Identity Governance CA Identity Portal CA Risk Analytics CA Secure Cloud SaaS - Arcot A-OK (WebFort) CLOUDMINDER ADVANCED AUTHENTICATION CA Secure Cloud SaaS - Advanced Authentication CA Secure Cloud SaaS - Identity Management CA Secure Cloud SaaS - Single Sign On

Issue/Introduction

The attribute eTCreateDate and eTCreateTime contain odd numerical values.
Using manual means to “decrypt” the values can be cumbersome

Environment

Release: CAIDMB99000-12.6.7-Identity Manager-B to B
Component:

Resolution

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 

# 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