Forums

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

Convert date value

jiradev March 6, 2018

  Hi

How to convert the Date field in my velocity template that came after the ajax request from "dec 1, 2018" to "01.12.2018"?

  Thanks.

1 answer

0 votes
Vasiliy Zverev
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.
March 6, 2018

You should create two variables of SimpleDateFormat and use it for date conversion. Here is code example:

import java.text.SimpleDateFormat

SimpleDateFormat inputFormat = new SimpleDateFormat("MMM dd, yyyy", Locale.ENGLISH)
SimpleDateFormat outputFormat = new SimpleDateFormat("dd.MMMMM.yyyy", Locale.ENGLISH)

outputFormat.format(inputFormat.parse("Dec 01, 2018"))


Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events