1

I have this error: SyntaxError: missing ) after argument list

function:

function toTimestampArti(strDate, dk) 
{
        var birdk = 60000;
        var artidk = dk * birdk;
        var datum = Date.parse(strDate);
        var timeoff = new Date().getTimezoneOffset() * 60 * 1000 * -1;
        var time = datum + timeoff + artidk;
        return time;
}

run code:

toTimestampArti(strDate:06.01.2018 08:30:00, dk:10)
1
  • 1
    You don't call JavaScript functions with colons. Also strings have to be delimited with quotes. Looks like you are confusing JavaScript with another language. You are supposed to call this like toTimestampArti('06.01.2018 08:30:00', 10). Commented Jan 6, 2018 at 9:01

1 Answer 1

2

Just call with values, without giving the variable, because the order defines the argument.

For the date, you need to take a string.

toTimestampArti('06.01.2018 08:30:00', 10)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.