How do I create a local time(time zone -> UTC + 3:30
) that would show seconds with jQuery?
I do not want to use a plugin, and prefer a short code.
I do not use the following example because it gets the system time and is in javascript. It is only an example of what I want.
EXAMPLE of javascript: http://jsfiddle.net/HZmPg/
EDIT: What is your opinion about this code?
$(document).ready(function(){
var timezone = "Europe/Berlin";
$.getJSON("http://json-time.appspot.com/time.json?tz="+timezone+"&callback=?",
function(data){
if (data.hour < 12) {
alert ("Good morning in "+timezone);
} else {
alert ("Good afternoon in "+timezone);
}
})
});
If this can not be done with jQuery, what is the solution?