Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
10 replies
Subscribers
6 subscribers
Views
3233 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Hi you all, I need to convert the following string (type text) into a en_
Giobis
over 11 years ago
Hi you all,
I need to convert the following string (type text) into a en_US date format.
In a process I used a XOR for manage the locale of the initiator. If locale <> en_US i don't touch the string, but if the locale = en_US I need to convert all date in en format.
This is the array:
", , , , 26/06/13 12:04, 26/06/13 11:55, , , , , , , , "
I using this doforeach :
doforeach("pr_checkStringDateSpaceInArrayList",split(ri!date,", "))
and this Rule (pr_checkStringDateSpaceInArrayList) :
if(ri!date=" ",ri!date, datetext(userdatevalue(index(split(ri!date," "),1,"ERROR 1")),"MM/dd/yy")&" "&index(split(ri!date," "),2,"ERROR 2"))
The problem is that I use "26/06/13 12:04, 26/06/13 11:55" its works but with the previous array doesn't works.
Any suggestion for me?
Thanks a lot...
OriginalPostID-72276
OriginalPostID-72276
Discussion posts and replies are publicly visible
0
Giobis
over 11 years ago
appian 6.6.1
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Michael Tan
Appian Employee
over 11 years ago
In trying to test your rule with a gregorian Calendar, I ran in to an error with this expression: userdatevalue(index(split(ri!date," "),1,"Error 1")) -- It indicated that the date was out of range. Given that you know the setup of your text, can you use an expression like the following? This will simply extract the text and re-order it.
=mid(ri!dateText,4,2)&"/"&left(ri!dateText,2)&"/"&mid(ri!dateText,7,2)&" "&index(split(ri!dateText," "),2,"Error")
I would have used right(ri!dateText, 5), but I am not sure how all the time values will be treated.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Giobis
over 11 years ago
Thanks Michael... it works with this rules:
=if(ri!date="",ri!date,mid(ri!date,4,2)&"/"&left(ri!date,2)&"/"&mid(ri!date,7,2)&" "&right(ri!date,5))
Now, How I can convert the time (eg. 20:30 italian) into 8:30 PM Usa ?
thanks a lot
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Michael Tan
Appian Employee
over 11 years ago
Wrap the initial expression provided, right(ri!date,5), with timevalue(right(ri!date,5))
The timevalue expression converts a time_text with a passed value of 20:30 in to 8:30 PM.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Giobis
over 11 years ago
I tried to create a rule (for test). The role have as paramenter dateText
timevalue(right(ri!dateText,5))
but, if I use this string : 26/06/13 20:30
the result is:
12:00 AM
Note: The locale is settings with : en_US
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Michael Tan
Appian Employee
over 11 years ago
I've tested with en_US locale and with different time zone settings, but I can not reproduce your error. This, however, has been on Appian 7.2. Are you seeing the issue at run time? rules interface?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Giobis
over 11 years ago
I use appian 6.6.1
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Giobis
over 11 years ago
I trued on appian 6.6.1 in rules interface and the behaviour is equivalent. It's very strange. Any suggestions?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Diana Chavez
Appian Employee
over 11 years ago
You can try using timevalue(right(ri!dateText,8)) and use the date 26/06/13 10:30 PM, this actually returns the time stamp as expected.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Giobis
over 11 years ago
Thanks you all.
The final rule is:
if(ri!date="",ri!date,mid(ri!date,4,2)&"/"&left(ri!date,2)&"/"&mid(ri!date,7,2)&" "&timevalue(time(mid(ri!date,10,2),mid(ri!date,13,2),"00")))
I tested it and it works well if I use locale = en_US
I check the locale by process and if the locale = en_US I apply this rule.
This rule are called by a doforeach expression because I've this array:
", , , , 26/06/13 12:04, 26/06/13 11:55, , , , , , , "
Thanks all for precious suggest
Regards
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel