Possible Duplicate:
Getting the client’s timezone in JavaScript
Is there anyway to get current timezone in javascript. All i see is
Date.getTimeZoneOffset()
The problem I am facing is, I have a piece of functionality which allows the users to download pdf, now the pdf has to include a 'download date' in it which should be users local date, have to do this in java. But its all confusing, I dont know if i should locale or not or just the timezone will work, each time when i try something the results are different!!!!
Use Date.toTimeString()
Code:
var date = new Date();
document.write(date.toTimeString());
Output:
22:53:21 GMT+0530 (India Standard Time)
^offset ^timezone
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With