I am trying to write a Javascript to get the local timezone (not UTC+5.30, etc but exactly like IST, PST, etc). I been trying for two days and I am finally here to ask for some pointers. I did googling and found the getTimezoneOffset function as well but I can not make use of it to get the desired result.
This code gives
Here, the UTC+0530 is the timezone which I have set in my system. but how will I make this UTC+0530 to become IST ?
I can go ahead and make a if condition for it but what if someone else in the US/any other country is trying to use this script? their case will be left out. So, it is practically impossible to put a lot of such IF conditions to check and print the Timezone as such.
I even checked out this site
I have tried all the functions which they have shown their but none of them seem to help me with what I want.
So, is there any way anyone aware of to print the timezone in ISt, GMT, EST, PST formats?
---------- Post updated at 11:42 AM ---------- Previous update was at 10:42 AM ----------
Guess I have found a way.. might not be the best
this returns
So, i think I may have to cut the Initial Alphabets of that string that's inside the bracket.
---------- Post updated at 12:21 PM ---------- Previous update was at 11:42 AM ----------
In case anyone else is interested, here is the script that gives you the timezone abbrviation alone
---------- Post updated at 01:05 PM ---------- Previous update was at 12:21 PM ----------
Oh damn! This works only in firefox.
The stupid IE, outputs only
toString
Sample Title
or
toTimeString
Sample Title
So, there is no way I can manipulate the timezone string IST there
There is no standard way of retrieving timezone information across browsers using JavaScript.
Even on Firefox, what is returned depends on whether you are using the SpiderMonkey or TraceMonkey engine. Here is what is outputted by the TraceMonkey JavaScript shell:
PHT = Philippines Time Zone
Hello Friends,
I tried to take tar backup in my server, but it ended with an error.
It said that:
/home/back/pallava_backup/fbackup_backup/stape_config
/home/back/romam_new.tar.gz
tar: /home/backup/back.tar.gz: Cannot write: No space left on device
tar: Error is not recoverable: exiting... (10 Replies)
Hi Folks,
My server time is in EDT. And i am sending automated mails from that server in which i need to display the current date time as per IST (GMT+5:30). Please advice how to display the date time as per IST.
IST time leads 9:30 mins to EDT. and i wrote something like below.
... (6 Replies)
Hi,
I want to run a job in 5 min duration and start time should be 21:30EST and endtime should be 18:30EST nextday. in long note, it will start from sunday 21:30EST to monday 18:30EST......monday 21:30 EST to tuesday 18:30 EST....tuesday 21:30 ESTto wednesday 18:30EST...wednesday 21:30EST to... (1 Reply)
Hi,
Can anybody tell me how to change time zone from ist to bst,
What changes should be done in /etc/TIMEZONE file.
wheather it is possible to change timezone without rebooting the server.
Regards
Manoj (1 Reply)
Hi,
The unix box has a system date in the PDT time zone format..if i need to capture the value of the date in a variable id do this:
orderdate=`date '+%Y%m%d'`
ordertime=`date '+%H%M%S'`
output :
$orderdate= 20060714
$ordertime= 043438
I need to convert and store this orderdate and... (2 Replies)
HI ;
I got Solaris8 installed oon Sunfire V440 .I have TZ=GMT in /etc/TIMEZONE , but when i log in as root i see the date in GMT+1.
So i have every time to "set TZ=GMT ; export $TZ" .
How can i set the TZ=GMT at the startup defenitely.
Thanks
:) (7 Replies)
Hi,
i am searching to change the timezone on a HP-UX11 system. Since last weekend the summertime started i am not able to change the time to the new time, every day the time changes back to wintertime. I think the problem is that the server is on the wrong timezone. Can someone help me please?... (1 Reply)
Hi,
I got an question about changing timezone thrue command line on a SunOS Release 4.1.2 without restarting the computer.
Now it's set on WET and I want to set the timezone to CET (GMT +1)
Plz somebody help me.
Regards
Novisern:confused: (5 Replies)
Hello again,
under hp-ux i have a file /etc/TIMEZONE. here is definied which timezone i am.
i dont know who reads this file to set after reading the timezone under /usr/lib/tztab.
my 2 questions, who reads the file /etc/TIMEZONE ( which service ) and do i need in the first line to set my... (6 Replies)