chuonchuonot102 Posted August 3, 2021 Share Posted August 3, 2021 Hi everyone,Could you please help me following issue?I have a date which has format dd/MM/yyyy.I'd like to get 2 last digit of the year.For example: input: 04/08/2021 => output: 21I've tried 2 options as below but it still show error as attached screenshot.Not that: net.myDomain.tools.Ft.formatDate($F{signDate},"dd/MM/yyyy") is correct method that using in my project.net.myDomain.tools.Ft.formatDate($F{signDate},"dd/MM/yyyy")).toString().subStr(8,9)net.myDomain.tools.Ft.formatDate($F{signDate},"dd/MM/yyyy")).toString().subString(8,9)Do you have any idea?Thanks!Phuc Link to comment Share on other sites More sharing options...
Solution luked Posted August 3, 2021 Solution Share Posted August 3, 2021 Morning,2 ways you can try. 1 is to change the formatting of the date in the textfield as per attached picture. 2 is try the following - $F{signDate}.substring($F{signDate}.length() - 2) Link to comment Share on other sites More sharing options...
chuonchuonot102 Posted August 4, 2021 Author Share Posted August 4, 2021 Dear luked,You did a really good help. It works!Many thanks!Phuc Link to comment Share on other sites More sharing options...
chuonchuonot102 Posted August 4, 2021 Author Share Posted August 4, 2021 both 2 solutions work! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now