You need to used Calendar.getInstance() instead of GregorianCalendar. 
With Calendar you can do something like this (writing from memory so might 
have compilation issues):

Calendar cld = Calendar.getInstance();
cld.set(Calendar.YEAR, 2010);
cld.set(Calendar.MONTH, Calendar.JANUARY);
cld.set(Calendar.DAY_OF_MONTH, 1);
long time = cal.getTime().getTime();
On Friday, September 18, 2020 at 2:31:26 AM UTC+3 [email protected] wrote:

> I am trying to use some existing code with Codename one.
>
> I need to be able to duplicate the following 
>
> *private final long BASE_TIME = new GregorianCalendar(2010, 1, 
> 1).getTimeInMillis();*
>
> How must I define BASE_TIME in a Codename One App  so that it will 
> function the same as the code above?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/bcb62084-faca-4cc4-be6f-6e27869ea7bbn%40googlegroups.com.

Reply via email to