PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Retrieve date from internet time servers
Retrieve date from internet time servers
Iniciado por guest, 08,may. 2015 16:54 - 7 respuestas
Publicado el 08,mayo 2015 - 16:54
Hi

Is there a way to retrieve the date and time from any internet time server with Windev ?
Publicado el 08,mayo 2015 - 18:17
I don't know why you need it and how accurate your app must be.
If some delay is ok for you, you can retrieve this information from several source like
http://www.timeapi.org/utc/now or <a class="ExternalLink" rel="nofollow" target="_blank" href="http://www.earthtools.org/webservices.htm">http://www.earthtools.org/webservices.htm</a> using HTTPRequest and HTTPGetResult
Publicado el 08,mayo 2015 - 18:22
Hi Cesar,

yes, there's an example in the online repository for accessing a time-server via the NTP protocol. Unfortunately, currently all downloads from the repository do not work. The link is: http://repository.windev.com/resource.awp…

If time has not to be exact to the millisecond then you can use any good server and get its header info where date / time are included.
I've written a small example for this: <a class="ExternalLink" rel="nofollow" target="_blank" href="http://www.windev.at/files/GetDateTimeByHTTP.zip">http://www.windev.at/files/GetDateTimeByHTTP.zip</a>
Publicado el 08,mayo 2015 - 19:28
Thanks guys.

I just need the correct date to avoid user entry records while date is not correct.

I will take a look at this links.
Publicado el 08,mayo 2015 - 20:12
datesys()
Publicado el 09,mayo 2015 - 07:24
Hi Allard,
DateSys() depends on date / time of the local Windows / Linux / Java System. If you deliberately change the date / time of the local computer then DateSys() will retrieve this date / time.

E.g. if you set a 30 day limit for a trial software and the user wants to illegally extend the trial period then s/he just needs to set the computer's clock back to install date / time and that's it.

In a multi-user system it is crucial to have the correct date / time on all of the computers if you want to see the transactions in the original sequence. If there a central stock-values maintained, this is absolutely necessary. In such a case even mobile devices need to have the correct date / time.
Publicado el 11,mayo 2015 - 17:15
Hi Julio,

Are you using the HFSQL C/S server? Because if so and the server's date is acceptable in your case, you can also simply use HInfoServer() to get the server's date and time. This would be another solution in that use case.

Best regards,
Alexandre Leclerc
Publicado el 11,mayo 2015 - 17:23
If it's only for that, just get the date/time form db engine and manage only the dete/time of your database server.
You can change your server setting to use one official NTP server to set the correct date/time.

HFSQL - HInfoServer("MyConnection",hInfoDate)
MSSQL - SELECT GETDATE() AS CurrentDateTime
ORACLE - SELECT SYSTIMESTAMP FROM DUAL
MYSQL - SELECT NOW()