Good day,
I am trying to get the miliseconds in a Date Text field.
I tried using the below
{{#now}}toMillis{{/}}
But it does not give it to me in date format.
Hi All,
I just wanted to extract the milliseconds. We needed it for reporting that we needed to do.
This was my solution: {{issue.created.format("yyyy-MM-dd HH:mm:ss")}}
Hi @Mareli
Please try this one:
{{#now}}format="toMillis"{{/}}
That may be chained with other function usage, such as this:
{{#issue.customfield_12345}}func=plusDays(2), format="toMillis"{{/}}
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your question, you asked about using the milliseconds format, which is an integer number since the start of Epoch time (i.e., a UNIX timestamp).
Returning to Trudy's question: what problem are you trying to solve? And what would be an example date / time format that would help you solve that?
Knowing those will help the community offer better suggestions. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Mareli
Can you provide a link to the reference document where you found toMillis? I'm not finding that in the documentation for Smart Values that can be used with date and time fields.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
millis can be used as a unit of measure in the date/time difference function, and in the plus and minus functions to calculate a new date.
You aren't use either the diff or plus/minus functions.
What are you trying to accomplish with your calculation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I seem to recall that Jira DC on MySQL doesn't use milliseconds in the database. Not sure if that applies in Cloud as well
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just wanted to extract the milliseconds. We needed it for reporting that we needed to do.
This was my solution: {{issue.created.format("yyyy-MM-dd HH:mm:ss")}}
If you look at the documentation for smart value functions/formatting for date/time values:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
...there is a reference at the bottom of the formatting table to additional formatting commands in Java documentation.
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
According to that documentation you would use "S: to get fractions of a second.
{{issue.created.format("yyyy-MM-dd HH:mm:ss:S")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.