Getting time from an online time server
Blitz3D Forums/Blitz3D Programming/Getting time from an online time server
| ||
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... |
| ||
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! |
| ||
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? |
| ||
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! |
| ||
AH! Ho hum. Well maybe I'll just write a DLL / userlib thnag for the community. Would there be any interest? |
| ||
Very likely. all the best with this, BS! |
| ||
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? |
| ||
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.) |
| ||
Apocalypse fancy making that lib available? |
| ||
Sure. I put up some demo code too. Look for it here... http://www.blitzbasic.com/logs/userlog.php?log=440&user=7138 |
| ||
What would be really useful is a function just to get the time from the atomic clock not just set the pc time. |
| ||
VIOLA! http://www.blitzbasic.com/logs/userlog.php?log=440&user=7138 |