Forums

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

How do I covert the below Date format

Kumar, G Sunil October 21, 2021

Hello,

 

Can we covert the following 

 

startdate = "2021-10-22T07:46:42Z"
startdateS = new Date()
startdateV = startdateS.parse("yyyy-MM-dd'T'HH:mm:ss+0100", startdate)

 

That is startdateV = 2021-10-22T07:46:42+0100

 

Can anyone help?

 

Regards,

Sunil

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 21, 2021

Where?  I mean where is the code that you'll need to run going to be executed?  Validator?  Post function?  Scripted field?

Kumar, G Sunil October 21, 2021

Hi @Nic Brough -Adaptavist- ,

 

I am running this as JOB where I am getting the Date value as above and I am trying to convert it so that I can update this into a custom field.

 

Regards,

Sunil 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 22, 2021

Ok, and what type of field is this custom field?

Kumar, G Sunil October 24, 2021

It is a date time custom field

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 25, 2021

Great, those are quite easy to populate - see https://library.adaptavist.com/entity/update-the-value-of-custom-fields-through-the-script-console for an example of doing it in the console (it'll translate straight into a listener)

Kumar, G Sunil November 16, 2021

Hi @Nic Brough -Adaptavist- ,

 

I tried to look into it but my main requirement is covert the above data to JIRA date format is there something similar because I couldn't find it the Library.

 

Regards,

Sunil

Suggest an answer

Log in or Sign up to answer