Forums

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

jql how to convert date epoch timestamp to date

Eliran Naim
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2018

Hey

I have this line code

selectors: [{ selector: '(user["registrationDate"] >= datetime(1541376000) and user["registrationDate"] < datetime(1541462399))'}]

I'm looking to some function that convert regular date to epoch timestamp so I cn use regular date in the filter

 

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 20, 2018

Jira's JQL language does not have an function like CAST() does for SQL language in order to take input in one format and convert it into another format like SQL can do.

If you're looking to do this in application of Jira, then perhaps it could be accomplished by the use of a 3rd party plugin like the SQL+JQL Driver plugin.  I am not certain this would work yet, but my understanding of this plugin is that it provides some more SQL like functions to be used in JQL.  So perhaps something like cast could be used in order to convert your epoch time value into a date/time value that Jira could understand.

But if that doesn't work, could you tell me more about your code and implementation here?  Are you building a plugin for Jira?  Or are you just trying to run a script?  If I can understand what scripting language you might be using (python, perl, etc) maybe we can better understand if this conversion can be done in the scripting language before sending the payload/request to Jira.

Suggest an answer

Log in or Sign up to answer