Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
Replies
6 replies
Answers
1 answer
Subscribers
9 subscribers
Views
3523 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Date Time Issue
ankitab918
over 8 years ago
When I am printing now(), it's returning 9/8/2016 3:11 AM EDT.
But for hour(now()), it's returning: 7
totime(now()): 7:11 AM
Default user timezone is UTC-5:00(Eastern Time)
How do I get the correct hour for the present time?
OriginalPostID-233588
Discussion posts and replies are publicly visible
Top Replies
pavithrac
over 8 years ago
+1
It seems that hour function is not working with datetime time stamp however it accepts time/datetime as per the documentation and also it seems that hour function is working if just time is passed to it…
Parents
0
ankitab918
over 8 years ago
Hi Vimals, This method works. I am able to extract the correct hour, however to change it back to date time, I am using the datetime() function and providing the hour I extracted before, but it is changing to a different value
now():9/8/2016 4:26 AM EDT
hour(totime(local(now()))):4
datetime(year,month,day,hour,min,sec):9/8/2016 12:26 AM EDT
local(datetime(year,month,day,hour,min,sec)):9/7/2016 8:26 PM EDT
todatetime(local(datetime(year,month,day,hour,min,sec))):9/7/2016 8:26 PM EDT
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
ankitab918
over 8 years ago
Hi Vimals, This method works. I am able to extract the correct hour, however to change it back to date time, I am using the datetime() function and providing the hour I extracted before, but it is changing to a different value
now():9/8/2016 4:26 AM EDT
hour(totime(local(now()))):4
datetime(year,month,day,hour,min,sec):9/8/2016 12:26 AM EDT
local(datetime(year,month,day,hour,min,sec)):9/7/2016 8:26 PM EDT
todatetime(local(datetime(year,month,day,hour,min,sec))):9/7/2016 8:26 PM EDT
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data