Welcome, Guest. Please login or register.
Did you miss your activation email?
March 20, 2010, 07:13:50 PM

Pages: [1]
  Print  
Author Topic: URL to supply the current time  (Read 245 times)
jfedison741
Newbie
*
Posts: 13


« on: January 31, 2010, 04:54:07 PM »

I am using the serial web services API and would like to use [[[get|url]]] to obtain accurate date and time information. I need resolution of seconds (getting the time from the ioBridge server only gives the time to the nearest minute).

Can anyone suggest a URL that gives the current time? Also, the URL needs to respond with fewer than 80 character to satisfy the limits of responses to [[[get|url]]].

Thanks.
Logged
zerogx
Full Member
***
Posts: 107


zerogx industries


WWW
« Reply #1 on: January 31, 2010, 11:20:42 PM »

are you looking for local time or greenwich mean time?
Logged

zerogx industries | imagineering solutions
jfedison741
Newbie
*
Posts: 13


« Reply #2 on: February 01, 2010, 09:46:24 AM »

GMT/UTC would be fine.
Logged
nick
Full Member
***
Posts: 138


« Reply #3 on: February 01, 2010, 01:46:06 PM »

http://time-a.timefreq.bldrdoc.gov:13/

Works in my browser.  Haven't tried it with the web API.

It uses the DAYTIME protocol.  More info here: http://www.kloth.net/software/timesrv1.php
Logged
zerogx
Full Member
***
Posts: 107


zerogx industries


WWW
« Reply #4 on: February 01, 2010, 07:12:36 PM »

The code for doing the time based on server time:
Code:

<html>
<head>
<?echo date('h:i A')?>
 </body>
 </html>


it will need a hosting environment with php enabled.
Logged

zerogx industries | imagineering solutions
nick
Full Member
***
Posts: 138


« Reply #5 on: February 01, 2010, 09:44:54 PM »

The code for doing the time based on server time:
Code:

<html>
<head>
<?echo date('h:i A')?>
 </body>
 </html>


That's another alternative.  You don't even have to include the HTML tags, I know the IOBridge will take straight text from a PHP page.

it will need a hosting environment with php enabled.
Logged
zerogx
Full Member
***
Posts: 107


zerogx industries


WWW
« Reply #6 on: February 01, 2010, 10:18:44 PM »

Code:
<html>
<?echo date('h:i A')?>
 </html>

This is the minimum amount of code needed for keeping with web standards. you would be fine to strip the html. It's not the right way, but you will be fine to do so.
Logged

zerogx industries | imagineering solutions
jfedison741
Newbie
*
Posts: 13


« Reply #7 on: February 03, 2010, 10:25:23 AM »

http://time-a.timefreq.bldrdoc.gov:13/

Works in my browser.  Haven't tried it with the web API.

It uses the DAYTIME protocol.  More info here: http://www.kloth.net/software/timesrv1.php

This works well. Be aware that occasionally the URL does not respond -- In 21 hours of [[[get|URL]]] at 2 minute intervals, I got 9 timeouts. I used a timeout interval of 3500 ms. In cases when the URL does not respond, I leave the timestamp blank and the API uses the current system time.
Logged
nick
Full Member
***
Posts: 138


« Reply #8 on: February 03, 2010, 01:23:22 PM »

If you go to the link they list a whole bunch of other DAYTIME servers, probably one of them is more reliable.  Just make sure to put the ":13" at the end of the URL.

http://time-a.timefreq.bldrdoc.gov:13/

Works in my browser.  Haven't tried it with the web API.

It uses the DAYTIME protocol.  More info here: http://www.kloth.net/software/timesrv1.php

This works well. Be aware that occasionally the URL does not respond -- In 21 hours of [[[get|URL]]] at 2 minute intervals, I got 9 timeouts. I used a timeout interval of 3500 ms. In cases when the URL does not respond, I leave the timestamp blank and the API uses the current system time.
Logged
Pages: [1]
  Print  
 
Jump to:  



 
Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
| © ioBridge Corporation | RSS Feed