ESH5T Terminals - Current DateTime | Telit Cinterion IoT Developer Community
December 10, 2014 - 12:23pm, 5181 views
I have ESH5T terminals. I write program to read data from another device.
In my projectI required current Date & Time and M write below code in java to get current datetime.
"Date myDate = new Date();"
--- returns "2004-01-01 00:00:10"
But it's return wrong datetime. I think it return factory date time of the terminal.
Also m try to set current datetime using AT command but when terminal power on/off then it's reset datetime to factory datetime.
So is there any way to set cuttent date time on terminal.
Any way to get inserted SIM card carriar network tower datetime and set to terminal.
Please help me.
The module does not preserve time after a powerloss and will reset back to 2004. On startup I connect to an NTP server to retrieve the time.
Thanks for replay,
Can you explain me more details for that?
Right now I confuse. You mean to say module automatically connect NTP server to retive the time while startup module and set datetime to module.
I need to write jave code for connect NTP server to retrive datetime and set datetime on my application.
If I need to write code, Please send me java emaple code to connect NTP server and retrive datetime if you have.
Please help me.
You can find an example how to obtain the date/time from internet using java in the following link:
Somewhere over the rainbow!!! Looking for the Oz Land!!!
Here's how to get the current time from network provider but this is operator dependant: