Description:
In the Admin/Provisioning Directory, the eTCreateDate and eTCreateTime attributes contain odd numerical values.
For example:
eTCreateDate = 0000110013
eTCreateTime = 0004055600
What format are these stored in and How can those values be converted into human readable date and time stamps?
DATE values:
In the Provisioning Directory, date values are stored as Julian date in "0000YYYDDD" format.
Where:
YYY is: current year - 1900 (the '-' represents minus sign)
DDD is: 3-digit day within the year, with leading zeros.
For example if you have: 0000108351 in the eTCreateDate attribute.
YYY=108 (which is derived from 2008-1900=108, assuming the current year is 2008)
DDD=351=16th December.
So 0000108351 refers to December 16th, 2008.
Using sample in description of this technical document, 0000110013, which means:
YYY=2010-1900=110
DDD=013=13th January
0000110013 refers to January 13th, 2010.
You can remote the leading zeros and use an online converter, such as:
https://www.longpelaexpertise.com.au/toolsJulian.php
https://apps.aavso.org/tools/julian-date-converter/
TIME values:
=-=-=-=-=-=-=-=-=-=-=-=
Time attributes are the number of 100th of seconds in the day.
For example if you have: 0004107500 in your eTCreateTime attribute, this converts to: 11h24m35s
(((11*60)+24)*60+35)*100 = 4107500 (i.e. 0004107500)
The following is an example of a Windows POWERSHELL Script to turn these values into human readable form:
Use an editor (notepad or your preferred editor) and create the file “get_eT_date_time.ps1”
Copy in the following to the file, save and exit:
#
# 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"
Then run the command and input the time and date to be converted:
powershell -file get_eT_date_time.ps1 -eTCreateTime 0004107500 -eTCreateDate 0000110013