Get specific time in raw data from server?

Stuff that don´t fit in the other categories.
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Get specific time in raw data from server?

Post by ayu »

Does anyone know where I can get the current time from a specific timezone from a server (to keep it accurate), in a raw format?

As in, this is what I could find so far:

Code: Select all

http://www.worldtimeserver.com/current_time_in_PK.aspx
But I want just a blank page with the time, nothing else (I really don't want to parse the whole page).
I could use NTP but I feel that my current idea would be more simple.

The reason I want the time from a server like this, is because I intend to have a script running on different servers in the world, and I want to make sure that they get the time from the exact same source, to use in an encryption algorithm.
And I don't want to trust the system time, as it can be incorrect.

Any ideas?
"The best place to hide a tree, is in a forest"

User avatar
ph0bYx
Staff Member
Staff Member
Posts: 2039
Joined: 22 Sep 2008, 16:00
15
Contact:

Re: Get specific time in raw data from server?

Post by ph0bYx »

Can't you use your timezone time and just add or subtract hours for specific timezones?

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Get specific time in raw data from server?

Post by ayu »

ph0bYx wrote:Can't you use your timezone time and just add or subtract hours for specific timezones?
Yeah but if the servers are in different time zones, and if I use the time on the server itself, then there might be a few minute difference, thus the idea I have with the algorithm might not work if there is a too great time difference.

Basically I want to send an encrypted message (the time is to be used as a part of a key) to one server, and then the server should decrypt it using the same timestamp.

I am going to attempt to make a "safe" authentication method for an IRC both, so that the data can't be used or replicated and sent again.
Basically, I want to encrypt it with the time stamp, so that the bot has to decrypt and use the command string within the same minute, and also so that the same string can't be used several times.
It's an idea that I am testing for my IRC-bot, but I'm not sure how safe it is yet ^^
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Re: Get specific time in raw data from server?

Post by bad_brain »

hm, will you have access to those servers so you can run your own script there, or do you want to be able to pull the time from ANY server? :-k
Image

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Get specific time in raw data from server?

Post by ayu »

bad_brain wrote:hm, will you have access to those servers so you can run your own script there, or do you want to be able to pull the time from ANY server? :-k
Yup, from ANY server.
Basically something like any computer does today when it syncs the time with an NTP server, just that I want a simpler way if possible, since this is just a small experiment, but I still don't want to parse a whole page for the time.
"The best place to hide a tree, is in a forest"

User avatar
lilrofl
Siliconoclast
Siliconoclast
Posts: 1363
Joined: 28 Jan 2009, 17:00
15
Location: California, USA
Contact:

Re: Get specific time in raw data from server?

Post by lilrofl »

why not use one of the atomic clocks around the world instead of the local server time?
knuffeltjes voor mijn knuffel
[img]http://i911.photobucket.com/albums/ac320/stuphsack/Sig.jpg[/img]

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Get specific time in raw data from server?

Post by ayu »

lilrofl wrote:why not use one of the atomic clocks around the world instead of the local server time?

Well yeah, it's something like that, that I want.
I want to avoid using local server time at all cost.
"The best place to hide a tree, is in a forest"

User avatar
maboroshi
Dr. Mab
Dr. Mab
Posts: 1624
Joined: 28 Aug 2005, 16:00
18

Re: Get specific time in raw data from server?

Post by maboroshi »

Why not use the Windows NTP protocol yourself? I am sure its programmable, but I could be mistaken.

If they are Linux servers I am sure Linux has its own methods/apis for something similiar to tap into

User avatar
lilrofl
Siliconoclast
Siliconoclast
Posts: 1363
Joined: 28 Jan 2009, 17:00
15
Location: California, USA
Contact:

Re: Get specific time in raw data from server?

Post by lilrofl »

maboroshi wrote:Why not use the Windows NTP protocol yourself? I am sure its programmable, but I could be mistaken.

If they are Linux servers I am sure Linux has its own methods/apis for something similiar to tap into
Linux uses NTP also
knuffeltjes voor mijn knuffel
[img]http://i911.photobucket.com/albums/ac320/stuphsack/Sig.jpg[/img]

Post Reply