Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why is convertDate function returning yesterday's date when I give it today's date?

NA1021 July 20, 2023

Hello,

My company is using Confluence Cloud. I created a form using Confiforms with a field named status and another field named completionDate. Using Confiforms Rules for Definition macro, I created a rule such that when the status is changed to "Completed" -- whose key is 4 in the status dropdown-- the completionDate field is automatically set to today's date in the US/Pacific time zone, which is where I am located. I used the convertDate function to force the time zone to Pacific since I will have users whose time zone may be different than mine. 

Here's the macro definition:

Capture.PNG

When I ran it and changed the status to Completed, the completionDate shows with yesterday's date.  

Incidentally, I tried using the formatDate function first which gave me another problem in that if I did this late in my day, the date returned is tomorrow's date

1 answer

1 accepted

1 vote
Answer accepted
Alex Medved _ConfiForms_
Community Champion
July 21, 2023

Hi @NA1021 

And welcome to this community

Why would you use the convertDate here? Why not just setting the completionDate to current time and that's it

It will be rendered in the user's timezone automatically (if completionDate is a date/date time field)

Alex

NA1021 July 21, 2023

Hi Alex,

That works! Good to learn that the date/time will automatically render in the user's timezone. Excellent. 

I have another issue but will open another ticket for it.

Best,

NA 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events