This content has been marked as final. Show 8 replies
use the getTime() method of your date instance and add 10.5*60*60*1000. use that sum (in the new Data() constructor) to create another date instance that will be afghanistan time.
So would it look like this??
date = mydate.getTime + 10.5.60*60*1000();
Tried it and did not work. I know I'm not understanding where to put this.
If I attached the code I get this error ....
')' or ',' expected
oops, that got garbled. try:
It still give the the same error, below is how i pasted it in ( the first part of code)...thanks for all you help kglad.
mydate = new Date(mydate.getTime() + 10.5.60*60*1000);
seconds = mydate.getSeconds();
minutes = mydate.getMinutes();
hours = mydate.getHours()+9;
day = mydate.getDay();
date = mydate.getDate();
month = mydate.getMonth();
year = mydate.getFullYear();
that dot between 10.5 and 10 should be a *
The problem is this script it that is is dependent on the local time of the computer. I'll get a different result because I'm on PST time. You'll need to use the UTC dates instead. Googling reveals that Afghanistan is UTC + 4:30, so this script should work.