<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.StileMessaggioDiPostaElettronica17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="IT" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">I need to convert a date format from gregorian calendar to Oracle Timestamp.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">By now I’m using this script that does the opposite (inside an output mapping):<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><i><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif"><expression><br>
<script xmlns:xsi="</span></i><i><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif"><a href="http://www.w3.org/2001/XMLSchema-instance%22" target="_blank" title="http://www.w3.org/2001/xmlschema-instance%22"><span lang="EN-US">http://www.w3.org/2001/XMLSchema-instance"</span></a></span></i><i><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif">
 xmlns:c="</span></i><i><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif"><a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3%22" target="_blank" title="http://midpoint.evolveum.com/xml/ns/public/common/common-3%22"><span lang="EN-US">http://midpoint.evolveum.com/xml/ns/public/common/common-3"</span></a></span></i><i><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif">
 xsi:type="c:ScriptExpressionEvaluatorType"><br>
<code><br>
import java.text.SimpleDateFormat;<br>
import java.text.DateFormat;<br>
<br>
DateFormat dtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");<br>
<br>
if (input!=null) {<br>
Date dt = dtf.parse(input);<br>
log.info("convertedValidFrom = " + dt);<br>
return com.evolveum.midpoint.util.MiscUtil.asXMLGregorianCalendar(dt);<br>
} else {<br>
return null;<br>
}<br>
</code><br>
</script><br>
</expression><o:p></o:p></span></i></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">How could I convert it to make it do the opposite?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;mso-fareast-language:IT">Andrea Picconi<o:p></o:p></span></b></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;mso-fareast-language:IT">IAM (Identity Access Management)</span></i><span style="font-size:10.0pt;mso-fareast-language:IT"><br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:IT"><img border="0" width="136" height="33" style="width:1.4166in;height:.3437in" id="Immagine_x0020_1" src="cid:image003.png@01D6BE9B.4322F0E0" alt="Innovery"></span><span style="font-size:10.0pt;mso-fareast-language:IT"><br>
Skype: precons</span><span style="mso-fareast-language:IT"><br>
</span><span style="font-size:10.0pt;mso-fareast-language:IT">T:  +39 06 51963439 (int. 196) <br>
</span><span style="font-size:12.0pt;mso-fareast-language:IT"><br>
</span><span style="font-size:10.0pt;color:black;mso-fareast-language:IT">Strada Quattro Palazzina A6 c/o Centro Direzionale Milanofiori, 20057 Assago (MI).<br>
</span><span style="font-size:10.0pt;mso-fareast-language:IT"><a href="http://www.innovery.net/"><span style="color:#0563C1">www.innovery.net</span></a> |  T: +39 06 519 63 439</span><span style="mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>