How to change date format?

15 views
Skip to first unread message

Gareth Murfin

unread,
Oct 25, 2018, 2:59:21 PM10/25/18
to CodenameOne Discussions

I have a method to create a date string like this

public String getTime() 
    {
        return (new Date(time * 1000L)).toString();
    }

this produces something like 2018-10-25 etc etc which appears to be for USA.
but how do I make this UK time ? IE.. 2018-25-10?

Shai Almog

unread,
Oct 26, 2018, 12:08:01 AM10/26/18
to CodenameOne Discussions
You need to use SimpleDateFormat or L10NManager to format a date.
Reply all
Reply to author
Forward
0 new messages