[midPoint] Idiot question concerning date/time handling

Pálos Gustáv gustav.palos at gmail.com
Fri Apr 17 08:53:08 CEST 2020


Hi Kevin,

yes you need to convert it, like this:
<expression>
  <script>
    <code>basic.parseDateTime("yyyy-MM-dd HH:mm:ss", "2020-04-17
07:00:00")</code>
  </script>
</expression>

Best regards,

Gustav


pi 17. 4. 2020 o 8:18 Collins, Kevin <K.J.Collins at hw.ac.uk> napísal(a):

> Hi everyone,
>
>
> I hope that everyone is well and coping with the new working patterns that
> many of us have had to adopt.
>
> I have a question that may have been answered previously, but I can't find
> it.
>
> The "source of truth" for user data is in a Postgresql table with
> start_date and end_date supplied. The columns for start_date and end_date
> are defined in the table as "timestamp without timezone" and take the form
> "yyyy-MM-dd HH:mm:ss", (example "2020-04-17 07:00:00").
>
> I'm trying to set up activation for any users coming in from this data
> feed so that Midpoint knows when it's time to create, activate, suspend or
> archive the user account. I have got the MidPoint database table connector
> connecting to the database and can import some attributes. However, I can't
> get the start_date into validFrom and end_date into validTo.
>
> =-=-=-=-=-=-=-=
> <activation>
>                     <validFrom>
>                         <inbound>
>                             <authoritative>true</authoritative>
>                             <exclusive>false</exclusive>
>                             <strength>normal</strength>
>                             <source>
>                                 <c:path>$account/attributes/start_date</
> c:path>
>                             </source>
>                             <target>
>                                 <c:path>$focus/activation/validFrom</
> c:path>
>                             </target>
>                         </inbound>
>                     </validFrom>
>                     <validTo>
>                         <inbound>
>                             <authoritative>true</authoritative>
>                             <exclusive>false</exclusive>
>                             <strength>normal</strength>
>                             <source>
>                                 <c:path>$account/attributes/end_date</
> c:path>
>                             </source>
>                             <target>
>                                 <c:path>$focus/activation/validTo</c:path>
>                             </target>
>                         </inbound>
>                     </validTo>
>                 </activation>
>
>
> =-=-=-=-=-=-=-=
>
> (And I haven't got a clue - yet!! - as to how to determine the
> administrative status from these dates. I think that it should be
> "undefined" to allow Midpoint to make the decision).
>
> Do I have to convert the dates from Postgresql's
> timestamp-without-timezone into something else?
>
> Help would be appreciated with this PoC.
>
> Stay safe, stay well !!
>
>
> Regards,
>
> -Kev_C
>
>
> --
> Kevin Collins,
> Edinburgh,
> Scotland, UK
>
>
> ------------------------------
>
> Founded in 1821, Heriot-Watt is a leader in ideas and solutions. With
> campuses and students across the entire globe we span the world, delivering
> innovation and educational excellence in business, engineering, design and
> the physical, social and life sciences. This email is generated from the
> Heriot-Watt University Group, which includes:
>
>    1. Heriot-Watt University, a Scottish charity registered under number
>    SC000278
>    2. Heriot- Watt Services Limited (Oriam), Scotland's national
>    performance centre for sport. Heriot-Watt Services Limited is a private
>    limited company registered is Scotland with registered number SC271030 and
>    registered office at Research & Enterprise Services Heriot-Watt University,
>    Riccarton, Edinburgh, EH14 4AS.
>
> The contents (including any attachments) are confidential. If you are not
> the intended recipient of this e-mail, any disclosure, copying,
> distribution or use of its contents is strictly prohibited, and you should
> please notify the sender immediately and then delete it (including any
> attachments) from your system.
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint
>


-- 
s pozdravom

Gustáv Pálos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200417/71189948/attachment.htm>


More information about the midPoint mailing list