|
|
|
#! /usr/bin/php
<?php
/*
Author - Marcus S. Xenakis 9/11/99
marcus@xenakis.net
Amateur Radio Callsign - WA2DCI
This script is distributed as-is under GNU public
license. Please leave the credit line in the script.
This script obtains the current Universal Time from
the National Institute of Standards and Technology
of the United States of America.
It can be used as ssi tag for an HTML page
<!--exec cgi="utcnist.cgi"-->
or and an include in another PHP script.
You many need to modify the first line for the path
to your PHP interpreter.
NOTICE: The time signals are corrected for network
propagation delays. You should select the time
server with the shortest network path to you.
Then modify the $site varible for that site.
For complete information on time servers see:
http://www.bldrdoc.gov/timefreq/service/nts.htm
*/
$site = "time-a.nist.gov";
$fp = fsockopen($site,13,&$errno,&$errstr);
if (!$fp) {
echo "Error Connecting to NIST\n";
} else {
$line = fread($fp,64);
fclose($fp);
$array = explode(" ",$line);
if ($array[5] == 4) {
echo "Error in NIST Time Signal\n";
} else {
echo substr($array[1],3);echo "-";
echo substr($array[1],0,2);echo " ";
echo "$array[2] ";
echo "UTC(NIST)\n";
}
}
?>
|
|
| A Timing Class Categories : PHP, PHP Classes, Date Time | | | Finding the day of the week for a specific date.
Categories : PHP, Databases, MySQL, Date Time | | | A wrapper function to format dates coming from a databases with the
same syntax as PHP's date() function. Categories : Date Time, Databases, PHP | | | pcCalendar class - Allows for the creation of calendars in HTML pages. All output functions can be easily overridden, refer to article 1471 for an example.
Categories : PHP, Date Time, Calendar, PHP Classes | | | A PHP Calendar function with CSS : add a cool calendar to any php page by just adding a calendar class based function. Categories : PHP, PHP Classes, Calendar, Date Time | | | PHP Round Clock - Must have Gif support to use this. Categories : PHP, Date Time, Graphics | | | A simple and fast calendar combining PHP and tables. Use this as a base for applications in which a calendar is needed. Categories : Date Time, PHP, Complete Programs, Calendar | | | Open and Close your website in fixed times . Categories : PHP, PHP Classes, Cron, Date Time | | | mysql date/time converters Categories : PHP, MySQL, Databases, Date Time | | | Creates three SELECT form fields: Month, Day, and Year. You give it a string which will be used to make the name for the three fields, and a number of seconds to use as the default date. If you give it blank for this value, the current date is used. Categories : HTML and PHP, PHP, Date Time | | | If you want to create select buttons featuring current date this example will show you how... Categories : Date Time, HTML and PHP, PHP | | | Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example. Categories : PHP, Date Time, PHP Classes, Calendar | | | calculus of the eastersunday Categories : BC math, PHP, Date Time, Databases | | | Functions used to define a schedule of holidays. Can define non-fixed holidays (eg. 3rd sunday of June). Categories : Calendar, Date Time, PHP | | | Monthly and Daily Upcoming Events calendar. Categories : Date Time, PostgreSQL, PHP, Calendar, Databases | |
|
|
|