JavaScript getting time zone when entering state and country (time zone to use in ics file) getting time zone in c#,getting time zone,getting used

Getting time zone when giving state and country in text box

is there any way to get the time zone of that place with this two values?

the input will be like

var state = 'New York' ;
var country = 'United States';

result should be

America/New_York

OR

get local time zone of the current browser?

I need this time zone to use in ics file.

Answer:1

This is impossible, for the simple reason that quite a few states span more than one timezone. See Wikipedia's list. Outside the US it can get even more complicated; I believe there are some cities that span multiple timezones.

You could cobble together guesses per state (e.g. by using that list), but if this is for figuring out the user's timezone, you'll probably have better luck just comparing the client clock with the server's UTC time and estimating based on country.

edit: Note that there's no way to ask the browser for the current timezone, either, and you can't guess reliably based on the current time, because there are many timezones where it's the same time right now but where DST is different. Your best bet is to find all the possible current timezones, estimate based on the user's location (which you also have to guess!), and just ask as a last resort.

Answer:2

i've created a function to get the pathname of the webpage and if it matches the id of the menu item then it will add a css property to the div tag, showing the div as current page. heres the website ...

i've created a function to get the pathname of the webpage and if it matches the id of the menu item then it will add a css property to the div tag, showing the div as current page. heres the website ...

  1. jquery apply attribute to multiple elements
  2. jquery apply attribute

var TwitterListModel = function (lists, selectedList) { // [...] this.addUser = function () { if (this.userNameToAdd() && this.userNameToAddIsValid()) { this....

var TwitterListModel = function (lists, selectedList) { // [...] this.addUser = function () { if (this.userNameToAdd() && this.userNameToAddIsValid()) { this....

  1. what is bond used for
  2. bind used as a noun in a sentence
  3. bind used as a noun

I would like to know if there is a way to modify an html item (i.e. a div) when a radio button is selected without using js. Here is the markup: <div class="container"> <input id="...

I would like to know if there is a way to modify an html item (i.e. a div) when a radio button is selected without using js. Here is the markup: <div class="container"> <input id="...

  1. highlighting html element

I was trying the following: f.addEventListener('submit',(function(frm){ var func = (function(e){somefunction(e,frm);})(e); })(f),false); But this is failing. I want to pass the form (f) as a static ...

I was trying the following: f.addEventListener('submit',(function(frm){ var func = (function(e){somefunction(e,frm);})(e); })(f),false); But this is failing. I want to pass the form (f) as a static ...

  1. javascript passing event as parameter
  2. javascript passing event to function
  3. javascript passing event
  4. javascript passing event onclick
  5. javascript onclick event passing parameters
  6. javascript passing parameters to event handlers
  7. javascript passing this to event handler
  8. javascript passing arguments to event handlers