We are trying to convert from CTIME to some string format and back
again.

We start with a value of 1427287057 from the IDV (Wed, 25 Mar 2015
12:37:37 GMT) convert to "20150325123737.0Z", which appears to be
correct.

We then, attempt, to convert "20150325123737.0Z" back to the original
value; but we end up with: 1427243857 (Wed, 25 Mar 2015 00:37:37 GMT)
which is 12 hours off.

Am I missing something?
Thanks.
-jim


Code:
--------------------
Applying policy: %+C%14CTesting Policy%-C.
Applying to modify #1.
Evaluating selection criteria for rule 'nwHireDate: Convert to Active Directory form'.
(if-op-attr 'nwHireDate' available) = TRUE.
Rule selected.
Applying rule 'nwHireDate: Convert to Active Directory form'.
Action: do-set-local-variable("lv-temp",scope="policy",token-op-attr("nwHireDate")).
arg-string(token-op-attr("nwHireDate"))
token-op-attr("nwHireDate")
Token Value: "1427287057".
Arg Value: "1427287057".
Action: do-strip-op-attr("nwHireDate").
Action: do-set-dest-attr-value("nwHireDate",token-convert-time(dest-format="yyyyMMddHHmmss",dest-tz="GMT0",src-format="!CTIME",src-tz="GMT0",token-local-variable("lv-temp"))+".0Z").
arg-string(token-convert-time(dest-format="yyyyMMddHHmmss",dest-tz="GMT0",src-format="!CTIME",src-tz="GMT0",token-local-variable("lv-temp"))+".0Z")
token-convert-time(dest-format="yyyyMMddHHmmss",dest-tz="GMT0",src-format="!CTIME",src-tz="GMT0",token-local-variable("lv-temp"))
token-convert-time(dest-format="yyyyMMddHHmmss",dest-tz="GMT0",src-format="!CTIME",src-tz="GMT0",token-local-variable("lv-temp"))
token-local-variable("lv-temp")
Token Value: "1427287057".
Arg Value: "1427287057".
Token Value: "20150325123737".
token-text(".0Z")
Arg Value: "20150325123737.0Z".
Evaluating selection criteria for rule 'reformat times - To IDV'.
(if-op-attr 'nwHireDate' changing) = TRUE.
Rule selected.
Applying rule 'reformat times - To IDV'.
Action: do-if().
Evaluating conditions.
(if-op-attr 'nwHireDate' available) = TRUE.
(if-op-attr 'nwHireDate' not-equal "") = TRUE.
Performing if actions.
Action: do-set-local-variable("lv-hiredate-value",scope="policy",token-op-attr("nwHireDate")).
arg-string(token-op-attr("nwHireDate"))
token-op-attr("nwHireDate")
Token Value: "20150325123737.0Z".
Arg Value: "20150325123737.0Z".
Action: do-set-local-variable("lv-hiredate-value",scope="policy",token-xpath("substring-before($lv-hiredate-value,".")")).
arg-string(token-xpath("substring-before($lv-hiredate-value,".")"))
token-xpath("substring-before($lv-hiredate-value,".")")
Token Value: "20150325123737".
Arg Value: "20150325123737".
Action: do-reformat-op-attr("nwHireDate",token-convert-time(dest-format="!CTIME",dest-tz="GMT0",src-format="yyyyMMddhhmmss",src-tz="GMT0",token-local-variable("lv-hiredate-value"))).
arg-string(token-convert-time(dest-format="!CTIME",dest-tz="GMT0",src-format="yyyyMMddhhmmss",src-tz="GMT0",token-local-variable("lv-hiredate-value")))
token-convert-time(dest-format="!CTIME",dest-tz="GMT0",src-format="yyyyMMddhhmmss",src-tz="GMT0",token-local-variable("lv-hiredate-value"))
token-convert-time(dest-format="!CTIME",dest-tz="GMT0",src-format="yyyyMMddhhmmss",src-tz="GMT0",token-local-variable("lv-hiredate-value"))
token-local-variable("lv-hiredate-value")
Token Value: "20150325123737".
Arg Value: "20150325123737".
Token Value: "1427243857".
Arg Value: "1427243857".
Action: do-if().
Evaluating conditions.
(if-op-attr 'accountExpires' available) = FALSE.
Performing else actions.
Action: do-if().
Evaluating conditions.
(if-op-attr 'lastLogonTimestamp' available) = FALSE.
Performing else actions.
Policy returned:

<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product version="4.5.0.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<modify class-name="user" event-id="0" qualified-src-dn="dc=net\dc=willeke\OU=people\OU=Ext\OU=B2B\OU=A gents\uniqueID=johnp8" src-dn="net\willeke\people\Ext\B2B\Agents\johnp8" src-entry-id="268068">
<association>78c6ad446a7d6b4b8627f30c9e2ae8ba</association>
<modify-attr attr-name="nwHireDate">
<remove-all-values/>
<add-value>
<value type="string">1427243857</value>
</add-value>
</modify-attr>
</modify>
</input>
</nds>

--------------------


--
jwilleke
------------------------------------------------------------------------
jwilleke's Profile: https://forums.netiq.com/member.php?userid=401
View this thread: https://forums.netiq.com/showthread.php?t=53649