Android Question DateTime.Now

sivakrith

Member
Licensed User
Longtime User
Hello,

Would like to know how DateTime.Now arrives the value in B4A and B4J.

Does it takes the value from computer?
Does it requires any internet connection to fetch value from somewhere?

Changing the computer system's Date and Time,
In B4A, it returns the correct value. Then from where it takes arrives the value?
In B4J, it takes the computer system's datetime and arrives the value.

I would like to arrive this value in a fool proof way. ie without depending on the system's datetime. Is it possible? Any suggestion?

Happiness Always
BKR Sivaprakash
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Hello,
I would like to arrive this value in a fool proof way. ie without depending on the system's datetime. Is it possible? Any suggestion?
We face this problem alot with clients, so the fool proof is to do the following :
1- Create a simple html page and upload it to a website (free hosting)
the html contains :
html:
<script>
  n =  new Date();
  y = n.getFullYear();
  m = n.getMonth() + 1;
  d = n.getDate();
  document.getElementById("date").innerHTML = m + "/" + d + "/" + y;
</script>
<p id="date"></p>
2- use webview or httpjob to read the date and time from the above html

This way no matter what is the device date and time or the format is, you will always get the correct datetime in the desired format.

:)
 
Upvote 0

sivakrith

Member
Licensed User
Longtime User
Sameer,

Mail sent to [email protected] is bouncing back. Though I've started a conversation with you and have mentioned the same and also my payment done to the full bundled in Amazing CRM thread, I'm repeating here, in the hope that you'll see anyone.
 
Upvote 0
Top