Robotic Process Automation (RPA)

Robotic Process Automation (RPA)

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  dateTimeFoRmat Custom Format is not work.

    Posted 01/18/22 03:00 AM
    Edited by donghyun shin 01/18/22 07:42 PM
    Hi.

    When I choosed "ko-KR" in dateTimeToText, then was not worked Custom Format.

    It's only returned "yyyy-MM-dd"

    ----------------------------------
    Sorry.
    My Question was not enough.

    I selected 'ko-KR' in design mode,
    Automatically insert double quotation marks at both side.

    As far as I know This was only happen select "ko-KR".
    ----------------------------------


    defVar --name dateAndTime --type DateTime --value "2019-08-05 12:18:18"
    defVar --name dateTimeText --type String
    defVar --name CustomFormat --type String --value "yyyy/MM/dd"
    dateTimeToText --culture "ko-KR" --date "${dateAndTime}" --usecustomformat  --customformat "${CustomFormat}" dateTimeText=value
    logMessage --message "${dateTimeText}" --type "Info"

    ------------------------------
    donghyun shin
    ------------------------------


  • 2.  RE: dateTimeFoRmat Custom Format is not work.

    Posted 01/20/22 09:32 AM
    Hi, the runtime is based on Microsoft's implementation of globalization. This seems an odd behavior, but there's a reason why. This question was raised here as well.
    Basically, the forward-slash means to use the "system date separator", which is "-' in Korean. To overwrite this behavior, just escape the slash with single-quotes, like in the code below:

    defVar --name dateAndTime --type DateTime --value "2019-08-05 12:18:18"
    defVar --name dateTimeText --type String
    defVar --name CustomFormat --type String --value "yyyy\\MM\\dd"
    dateTimeToText --culture "ko-KR" --date "${dateAndTime}" --usecustomformat  --customformat "yyyy\'/\'MM\'/\'dd" dateTimeText=value
    logMessage --message "${dateTimeText}" --type "Info"

    ------------------------------
    Joba Diniz
    Product Manager
    IBM
    ------------------------------