RhoElements Date bug

Using RhoElements on Windows CE:

var theDate = new Date();

theDate will have the date that the RhoElements App started running, not the current date. The time portion is also incorrect, but does keep advancing (there is a discrepancy between the time returned and the system time, but it seems to be small, about 30 minutes). The only way I have found to get the date to update is to exit and re start the app.

We have found this with the runtime versions 1 and 2, on both an MC3100 and MC3190.

Ord Millar
Something else:Method

Something else:

Method toLocaleString() outputs the wrong month (one month early).

toDateString(), toUTCString() and toISOString() show the correct month.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pietro Francesc...
Hi Ord,the small test that

Hi Ord,

the small test that follows works correctly with RE 1.0.3.11 on an ES400. Well, pressing the Update button, you see that the DateTime is correct. But you are right, the toLocaleString() report the wrong month (one early).

Sample code:

<html>

<head>

<title>Date Sample</title>

<script type="text/javascript">

function fnUpdateDate() {

    var currentTime = new Date()

    var month = currentTime.getMonth() + 1

    var day = currentTime.getDate()

    var year = currentTime.getFullYear()

    var myContent = month + "/" + day + "/" + year + "<BR>" + currentTime.toLocaleString()

    //alert(myContent);

    document.getElementById('para').innerHTML = myContent;

}

</script>

</head>

<body>

<h4>It is now</h4>

<p id='para'> </p>

<input type="button" onclick="fnUpdateDate()" value="Update"/>

</html>

~Pietro

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ord Millar
Pietro,you will have to keep

Pietro,

you will have to keep that test page open for 24 hours to see if the problem is happening in your installation.

Regards,

Ord

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ord Millar
The problem is in fact

The problem is in fact different than I first described.

What happens is that the MC3100 goes to sleep after a period of inactivity, and the time within RhoElements stops advancing. Exiting and re-entering elements re synchronizes the clock with the system clock.

To reproduce, it is sufficient to start RhoElements, check that the time is correct, then power down (without exciting elements) for a few minutes. Power back up, and observe that the time shown in elements is no longer correct.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pietro Francesc...
Ord,what OS is your MC3100

Ord,

what OS is your MC3100 using, CE6 or WM6.5? and which BSP?

I've done my testing on an ES400 with WM6.5 and BSP31.02 and, at this moment, I don't see this issue.

~Pietro

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pietro Francesc...
Ord,even my test on the ES400

Ord,

even my test on the ES400 show the stuck time.

This morning the time was in sync but after 4/5 hours moved just few minutes.

Pietro

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ord Millar
Thanks, I am glad to hear you

Thanks, I am glad to hear you can reproduce it. Now I need to find a solution, because our applications requires correct time stamps when we store information.

P.S. We used windows CE 6.0

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ord Millar
Do you know if there are

Do you know if there are plans to correct this, and when that might happen?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ord Millar
I have found a temporary

I have found a temporary solution to this problem:

The WEBSQL engine uses the system time, not the RhoElements time, so we can query the database to get the correct time:

 db = openDatabase('odm_ts','1.0','TimeStamp',1*1024*1024);
            
              db.transaction(function(tx){        
                    tx.executeSql("SELECT datetime('now','localtime') as t",[],
                    function(tx,result){
                        time = result.rows.item(0)['t'];
                        alert('Database has: '+time);                        
                    },
                    function(tx,error){
                        alert('Error:'+error.message);  
                    })      
    });      

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ord Millar
The above fix does not work

The above fix does not work for RhoElements 1.0.2.3

In the earlier version, SELECT datetime('now','localtime')

return a bad value. For example, now it is saying "6461-12-31 05:36:13"

So, we can't use this work around.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pietro Francesc...
Ord,Why are you using v1.0.2

Ord,

Why are you using v1.0.2.3?, there is newer release of RhoElements 1 and then the shared runtime of version 2.

Version 1.0.3.11 is available on the support site:

http://support.symbol.com/support/search.do?cmd=displayKC&docType=kc&externalId=13526&sliceId=&dialogID=409290709&stateId=1%200%20409280838

Pietro

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ord Millar
Hi Pietro,I have tested

Hi Pietro,

I have tested originally with 1.0.2.3 because that is what the client has installed. I checked here with the new version and found:

v1.0.3.11 does have the correct time in the WEBSQL engine, but wrong time from the javascript Date object. Also still has the error of showing one month early in the Date.toLocaleString() method.  Version 2 behaves the same.

We will ask our clients to upgrade to 1.0.3.11 and put in a patch to get the time from the database until there is a fix to the runtime.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi,Please forgive that I

Hi,

Please forgive that I haven't read the entire thread here but reading your first post I recognise the issue.

Unfortunately this was fixed just too late to make it into our 2.1 drop due out next week The fix for this will be in 2.2.

Regards,

Darryn.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments