Converting local time to UTC

E

Elie Grouchko

Hi All

1. I need to convert the local-time of the server on which I run my website
to UTC and I don't want to rely on the server local time and timezone (i.e.
I don't want to hardcode the timezone information), is there a generic way
to do this?
2. Is there a general for converting time between timezones in ASP?

Many thanks

Elie Grouchko
 
E

Evertjan.

Elie Grouchko wrote on 13 nov 2004 in
microsoft.public.inetserver.asp.general:
1. I need to convert the local-time of the server on which I run my
website to UTC and I don't want to rely on the server local time and
timezone (i.e. I don't want to hardcode the timezone information), is
there a generic way to do this?

Use an ASP jscript function:

<%
'' vbscript:
response.write currentUTC()
%>

<script language=jscript runat=server>
function currentUTC(){
var d, s;
d = new Date();
s = "Server current UTC time is: ";
s += d.toUTCString();
return(s);
}
</script>
 
E

Elie Grouchko

This relies on the client's computer time being correct, I'm looking for a
solution that doesn't rely on the client settings.
 
E

Evertjan.

Elie Grouchko wrote on 13 nov 2004 in
microsoft.public.inetserver.asp.general:
This relies on the client's computer time being correct, I'm looking
for a solution that doesn't rely on the client settings.

[topposting corrected]

No, you are wrong, Elie.

The above is totally serverside code,
no clientside code or clock is involved.
 
E

Elie Grouchko

Hi

Sorry, my mistake :)


Evertjan. said:
Elie Grouchko wrote on 13 nov 2004 in
microsoft.public.inetserver.asp.general:
This relies on the client's computer time being correct, I'm looking
for a solution that doesn't rely on the client settings.

[topposting corrected]

No, you are wrong, Elie.

The above is totally serverside code,
no clientside code or clock is involved.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top