There is a common error in the sample code. The line:
if (daylightsavings = true) {
should read:
if (daylightsavings) {



On Thursday, November 1, 2018 at 8:51:47 PM UTC-4, poll...@outlook.com 
wrote:
>
> I managed by testing for windows phone as in:
>
>   DateUtil du = new DateUtil();
>         boolean daylightsavings = du.inDaylightTime(new Date());
>         int duoffset = du.getOffset(new Date().getTime());
>         Calendar now = Calendar.getInstance();
>         int hournow            = now.get(Calendar.HOUR_OF_DAY);
>         if (!isdesktop) {
>             if (platformname.equals("win")){
>                 if (daylightsavings = true) {
>                     hournow = hournow + 1;
>                 }
>             }
>         }
>
> Thank you for reading... -Russ
>
> On Thursday, November 1, 2018 at 4:53:06 PM UTC-4, poll...@outlook.com 
> wrote:
>>
>> If you are experiencing an issue please mention the full platform your 
>> issue applies to:
>> IDE: NetBeans/Eclipse/IDEA
>> Desktop OS
>> Simulator 
>> Device
>>
>> I have:
>>
>>         Date dNow = new Date();
>>         SimpleDateFormat ft = new SimpleDateFormat("h:mm");      
>>         String s$ = ft.format(dNow);      
>>         button1.setText(s$);
>>
>> The time is correct on Windows desktop, (the simulator), and on Android.  
>> On Windows Phone the time is an hour early.  Any thoughts on what is 
>> happening?
>>
>>

-- 
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 codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/0e916de6-dce2-42cf-8e76-b502bc200942%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to