Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Server's Time!

Original Message
Name: Stephen Allden
Date: October 25, 2006 at 04:58:50 Pacific
Subject: Server's Time!
OS: Win XP Home
CPU/Ram: 3.06Ghz, 512MB RAM
Model/Manufacturer: Acer, SA85
Comment:
Hiya Does Anyone Know How I Can Get This Javascipt To Use The Website's Server Time Instead of the user's system time.

http://www.stephenallden.co.uk/java...

Cheers!!! :-)


Report Offensive Message For Removal


Response Number 1
Name: Michael J (by mjdamato)
Date: October 25, 2006 at 07:11:25 Pacific
Subject: Server's Time!
Reply: (edit)
You again! LOL.

Unless the server is running ASP, you can't. And, if the server is not running ASP and this is the only reason you want to, I think that would be a lot more trouble than it's worth.

Are you having problems with the previous code not working to adjust the user's time to your local time?

Michael J


Report Offensive Follow Up For Removal

Response Number 2
Name: Michael J (by mjdamato)
Date: October 25, 2006 at 07:21:13 Pacific
Subject: Server's Time!
Reply: (edit)
By the way, why did you revert back to the long way of doing that code? I.e. writing the complete line of HTML within each line. If you want each line to be the same (with the exception of the image name) you should just use the IF/ELSE's to determine the image name and then write the HTML.

Doing otherwise can create major headaches down the road if one line has a mistake in it. Plus, you need to end the document.write commands with a semicolon.

time = day.getHours()*60 + day.getMinutes();

if(time<300) { // 12:00 am

imgname = "1.gif"

} else if(time<600) { //5:00 am

imgname = "2.gif"
.
.
.
}

document.write('');

Michael J


Report Offensive Follow Up For Removal

Response Number 3
Name: fleetmack
Date: October 25, 2006 at 14:14:22 Pacific
Subject: Server's Time!
Reply: (edit)
if you wnat to use php this will work for pulling the server's time (you can adjust the server time by adjusting the first variable)

<?php
$hourdiff = "0"; // hours difference between server time and local time
$timeadjust = ($hourdiff * 3600);
$melbdate = date("l, F d, Y h:i a",time() + $timeadjust);
print ("$melbdate");
?>


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Server's Time!

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




My PC has been hijacked!

Lexmark 2600 Printer Issues

btk1w1 infected start here post

Unwanted message remians on screen

Slow boot time


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC