Getting time from an online time server

Blitz3D Forums/Blitz3D Programming/Getting time from an online time server

Boiled Sweets(Posted 2005) [#1]
Has anyone ever tried to get time from an online atomic clock in Blitz?

I was thinking writing something. I reckon it would be useful for timed demos i.e. after a certain date the application stopped working...


_PJ_(Posted 2005) [#2]
Could you have a server-program that runs constantly and overwrites a file with the system date (perhaps stored as Julian number)

Then the client application downloads and reads this tiny file from the server and checks the details.

There must be so many better ways to do this!


Boiled Sweets(Posted 2005) [#3]
Malice,

if you are going out to the internet to read a file of a server you might as well read the time from an atomic clock via NTP. No messing with server side and funny little files.

What other better ways do people have / use?


_PJ_(Posted 2005) [#4]
Yeah I knew it wouldnt be the most efficient or 'cleanest' way to do it, but it's just what I would do given my limited exsperience and knowledge!


Boiled Sweets(Posted 2005) [#5]
AH! Ho hum. Well maybe I'll just write a DLL / userlib thnag for the community.

Would there be any interest?


_PJ_(Posted 2005) [#6]
Very likely. all the best with this, BS!


Apocalypse(Posted 2005) [#7]
I have an Internet Clock function in my Userlib but I used the Daytime Protocol (RFC-867) instead of NTP. Do you think there is a big difference or desire to use one protocol over the other?


BlackJumper(Posted 2005) [#8]
If you are writing a network play game, then this is probably fine... I'm sure you have considered the poor people who have dialup or who have no internet access on their machines. (e.g. kids download game at school; install on home machine.)


Boiled Sweets(Posted 2005) [#9]
Apocalypse

fancy making that lib available?


Apocalypse(Posted 2005) [#10]
Sure. I put up some demo code too.

Look for it here...

http://www.blitzbasic.com/logs/userlog.php?log=440&user=7138


Boiled Sweets(Posted 2005) [#11]
What would be really useful is a function just to get the time from the atomic clock not just set the pc time.


Apocalypse(Posted 2005) [#12]
VIOLA!
http://www.blitzbasic.com/logs/userlog.php?log=440&user=7138