473,385 Members | 1,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

timezone in javascript

Hi!

I have a javascript serverside script that stores the "Date" command in a
database.
The problem is that I am in Norway, ans the server is in Florida!
It's a BIG timedifference.

When I use ASP I just use the <% Session.LCID = 1044 %> command at the top
of the page.

Is there something like this javascript also?

Thanks!
Christopher Brandsdal
Jul 19 '05 #1
2 8597
Christopher Brandsdal wrote on 20 aug 2003 in
microsoft.public.inetserver.asp.general:
I have a javascript serverside script that stores the "Date" command
in a database.
The problem is that I am in Norway, ans the server is in Florida!
It's a BIG timedifference.

When I use ASP I just use the <% Session.LCID = 1044 %> command at the
top of the page.


A "javascript serverside script" is ASP !

ASP is not another word for vbscript !

ASP is a platform both for jscript and vbscript.

Session.LCID = 1044 (Nynorsk) should also work for jscript,
but it changes only the DATEFORMAT, not the TIMEZONE.
=====================

Perhaps the best serverside javascript for your question is IMHO:

d = new Date();
tz = d.getTimezoneOffset();

With the variable tz, the difference between the servertime and UTC, you
can construct your own local time in serverside jscript and in serverside
vbscript.

The translation from UTC to your local (summer)time cannot be done
without you suplying the specific info for that.

=================================

another way to get UTC:

<script language="JScript" runat=server>
var d = new Date();
var utcd = d.toGMTString();
Response.Write('Current = ' + d + '<br>UTC = ' + utcd );
</script>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
Maybe this, from http://www.aspfaq.com/2218 is useful:

<script language="JScript" runat=server>
var od = new Date();
var nd = od.toGMTString();
Response.Write('Current = ' + od + '<br>UTC = ' + nd);
</script>

"Christopher Brandsdal" <ch***********@c2i.net> wrote in message
news:ue**************@TK2MSFTNGP09.phx.gbl...
Hi!

I have a javascript serverside script that stores the "Date" command in a
database.
The problem is that I am in Norway, ans the server is in Florida!
It's a BIG timedifference.

When I use ASP I just use the <% Session.LCID = 1044 %> command at the top
of the page.

Is there something like this javascript also?

Thanks!
Christopher Brandsdal

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Google Mike | last post by:
I guess I'm confused by the whole timezone thing and I don't want to write a web app that gets this stuff wrong. I don't know how timezones work exactly -- is it just hours +/- on GMT or are there...
1
by: bhaskarna | last post by:
I have date(ex., Thu, 04 Dec 2003 10:35:19 +0500) and I know the timezone(ex., America/Anchorage). Now I need to convert the date into the given timezone. Is it possible to achieve this thru js...
7
by: Jim Davis | last post by:
I'm (still) working on an ISO 8601 date parser. I want to convert at least the formats described here: http://www.w3.org/TR/NOTE-datetime Well.. I've got most of it working (via RegEx's) good...
1
by: cnliou | last post by:
Hi! If I correctly understand v7.4 manual, value, say, '2003-11-26 12:00' in TIMESTAMP WITHOUT TIMEZONE column should output '2003-11-26 19:00' for "+08:00" timezone. The following test...
9
by: Allen Davis | last post by:
Is there no way in ASP.NET to retrieve the client's timezone (or even local time, I'd settle for that) and passing it to the server? There must be a way of determining the timezone from which the...
18
by: newbie | last post by:
Hi, I wonder if it's possible to detect a user (the browser's) timezone when he/she access my php file? I saw ppl suggesting using javascript to collect that information. But I wonder if it's...
2
by: =?Utf-8?B?Sm9ubnk=?= | last post by:
I have an ASP.NET 2.0 C# web application that is contacting an Exchange server using WEBDAV. It allows the users to look up appointments for a future date. The problem I have is determining the...
9
by: praveen1983 | last post by:
i want to get client TimeZone name .for ex .if i am changing my timezone to CST it should change in my prgm thru javascript,and then it has to show the TimeZone name and current time also..
4
by: Rohit | last post by:
I am trying to get client machine's timezone from my java script . But i have no idea how would i be able to get it in uclibc format. (e.g. GMT+0IST-1,M3.5.0/01:00:00,M10.5.0/02:00:00) . I saw...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.