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
+1
person also asked this
people also asked this
Replies
5 replies
Subscribers
8 subscribers
Views
4936 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hello: I am trying to convert a datetime from current timezone (India
marky
over 8 years ago
Hello:
I am trying to convert a datetime from current timezone (India GMT+05:30) to (GMT GMT+0) timezone
none of the attempts have given me the correct result which should be:
6/8/2016 12:01 AM GMT+05:30
The starting datetime is:
datetime(2016, 06, 08, 0, 01)
6/8/2016 5:31 AM GMT+05:30
Attempts:
local(datetime(2016, 06, 08, 0, 01),1200)
6/9/2016 1:31 AM GMT+05:30
local(datetime(2016, 06, 08, 0, 01),"GMT")
6/8/2016 5:31 AM GMT+05:30
gmt(datetime(2016, 06, 08, 0, 01),1200)
6/7/2016 9:31 AM GMT+05:30
gmt(datetime(2016, 06, 08, 0, 01),"GMT")
6/8/2016 5:31 AM GMT+05:30
rule!minusMinutes(330, datetime(2016, 06, 08, 0, 01))
6/9/2016 12:01 AM GMT+05:30
/* rule!minusMinutes */
fn!datetime(fn!year(ri!dateTime), month(ri!dateTime), day(ri!dateTime), hour(ri!dateTime), minute(ri!dateTIme)-ri!minutesToSubtract, second(ri!dateTIme))
OriginalPostID-218092
OriginalPostID-218092
Discussion posts and replies are publicly visible
0
Lakshmi Meyyappan
over 8 years ago
Read through the comments on this post, it may answer your question:
forum.appian.com/.../e-155590
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
raghunandanj3904
Certified Senior Developer
over 8 years ago
can u just try the gmt function without any second param:
eg: gmt(ri!dateTimeInp)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
raghunandanj3904
Certified Senior Developer
over 8 years ago
afaik, the GMT function will return the GMT time corresponding to the input date time and the returned value will be in the PrimaryTime Zone set in the Appian environment.
Other words, if you pass the date time field as 15/06/2016 05:30 AM the result will be 15/06/2016 00:00 AM IST
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Rajasekhar Pamidipati
A Score Level 2
over 8 years ago
Hi marky,
as per my understanding of your problem you can try the below ways to get the solutions,
gmt(datetime(2016, 06, 08, 0, 01),"GMT+05:30") or
local(datetime(2016, 06, 08, 0, 01),"GMT-05:30").
If the given solution is not correct for your problem then please elaborate your inputs and outputs once.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
narasimhaadityac
A Score Level 2
over 8 years ago
Hi Mark,
Can you try using usertimezone as below and see if it works?
gmt(now(),usertimezone(fn!loggedInUser()))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel