By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,636 Members | 1,207 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,636 IT Pros & Developers. It's quick & easy.

How to get uclibc style timezone string (e.g GMT+0IST-1,M3.5.0/01:00:00,M10.5.0/02:00:00)from javascript

P: n/a
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 couple of posting
on net from which suggest getTimezoneoffset or may be calculation with
dates from script gives correct offset including day light saving
time but i am not sure how correct this is. Again even if its
correct , its not telling me when (exact date and time )day light
saving adjustment starts and ends which is last part of /etc/TZ
string, Is there a way to get this from java script.

-- Rohit
Jul 2 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Jul 2, 10:48*am, Rohit <will.u.tellmem...@gmail.comwrote:
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 couple of posting
on net from which suggest getTimezoneoffset or may be calculation with
dates from script *gives correct *offset including day light saving
time but i am not sure how correct this is. Again even if its
correct , its not telling me when (exact date and time )day light
saving adjustment starts and ends which is last part of /etc/TZ
string, Is there *a way to get this from java script.
You mean JavaScript; or you mean Java and are in the wrong place.
And I guess you mean BST not IST. That is not a timezone; a timezone
reflects only Standard (Winter) Time, and does not change with the
seasons. The timezone corresponds to the first number in the string.

My Web page <URL:http://www.merlyn.demon.co.uk/js-date5.htmdoes
rather the opposite. And <URL:http://www.merlyn.demon.co.uk/js-
date2.htm>
shows how to determine the transitions for a given year. That, done
for
a few years, should enable the numerical part of the string to be
determined

The acronyms cannot in general be obtained. In any case, they are not
well-defined.

--
(c) John Stockton, near London, UK. Posting with Google.
Mail: J.R.""""""""@physics.org or (better) via Home Page at
Web: <URL:http://www.merlyn.demon.co.uk/>
FAQish topics, acronyms, links, etc.; Date, Delphi, JavaScript, ...

Jul 2 '08 #2

P: n/a
On Jul 2, 6:14 pm, Dr J R Stockton <J.R.Stock...@physics.orgwrote:
On Jul 2, 10:48 am, Rohit <will.u.tellmem...@gmail.comwrote:
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 couple of posting
on net from which suggest getTimezoneoffset or may be calculation with
dates from script gives correct offset including day light saving
time but i am not sure how correct this is. Again even if its
correct , its not telling me when (exact date and time )day light
saving adjustment starts and ends which is last part of /etc/TZ
string, Is there a way to get this from java script.

You mean JavaScript; or you mean Java and are in the wrong place.
And I guess you mean BST not IST. That is not a timezone; a timezone
reflects only Standard (Winter) Time, and does not change with the
seasons. The timezone corresponds to the first number in the string.

My Web page <URL:http://www.merlyn.demon.co.uk/js-date5.htmdoes
rather the opposite. And <URL:http://www.merlyn.demon.co.uk/js-
date2.htm>
shows how to determine the transitions for a given year. That, done
for
a few years, should enable the numerical part of the string to be
determined

The acronyms cannot in general be obtained. In any case, they are not
well-defined.

--
(c) John Stockton, near London, UK. Posting with Google.
Mail: J.R.""""""""@physics.org or (better) via Home Page at
Web: <URL:http://www.merlyn.demon.co.uk/>
FAQish topics, acronyms, links, etc.; Date, Delphi, JavaScript, ...
No no acronym are not real concern. I just put on string for example.
By timezone here what i really mean is string which indicates
following things.
(TZ env variable in embedded systems if you happen to know)

Need to know offset from GMT : e.g. GMT+5:30
Start of Daylight saving time : M3.5.0/01:00:00 : meaning at 1 on 0
th day(sunday), Week 5
Month: March
End of Daylight saving time : M10.5.0/02:00:00 : meaning at 2 on
0th day(sunday), Week 5
Month: October

--Rohit
Jul 2 '08 #3

P: n/a
On Jul 3, 7:12*am, Rohit <will.u.tellmem...@gmail.comwrote:
I have also started separate thread for this question.
Discussion fragmentation is deeply annoying, and leads to a loss of
interest in helping you.

Don't refer to articles by display position; that dependa in the
reading agent and its settings. Give thread subject, date, author,
message-ID.

Be aware that excessively long Subjects are a PITA.

Read, understand, and follow the newsgroup FAQ and the other links
provided.

--
(c) John Stockton, near London, UK. Posting with Google.
Mail: J.R.""""""""@physics.org or (better) via Home Page at
Web: <URL:http://www.merlyn.demon.co.uk/>
FAQish topics, acronyms, links, etc.; Date, Delphi, JavaScript, ...
Jul 3 '08 #4

P: n/a
On Jul 3, 2:31 pm, Dr J R Stockton <J.R.Stock...@physics.orgwrote:
On Jul 3, 7:12 am, Rohit <will.u.tellmem...@gmail.comwrote:
I have also started separate thread for this question.

Discussion fragmentation is deeply annoying, and leads to a loss of
interest in helping you.
Yes but if you can divide the problem in multiple components and each
can be individually answered, i do not see any problem in this. If
they are related provide the link . (Thats how things anyway get
related).
Don't refer to articles by display position; that dependa in the
reading agent and its settings. Give thread subject, date, author,
message-ID.

Be aware that excessively long Subjects are a PITA.
Agreed but its not just you and me out there. There are people who
kind of expect enough description in subject so they can decide
whether to click there or not. Please do not impose your style upon
others.
>
Read, understand, and follow the newsgroup FAQ and the other links
provided.
I have done this but there are quite few good ways to do same thing
and not one always. We do not need to agree on each aspect of this
thing unless things go really bad. Having said that i still see your
point of short subject as valid but i do not understand why should
that make someone who is there to answer questions NOT respond to the
actual question.

Thanks,
Rohit

Jul 3 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.