Timestamp with each action

error: 'Get_UnixTime' was not declared in this scope
^all these errors are killin me. Do I need to import something or declare a overall time fn somewhere to use the get_unixtime?

Hi @jkkim93

As @wgbartley said, the console is your friend here. Another good way is to put a break point in your Javascript via the Javascript debugger (I like Chrome for debugging). You can then hover over variables and see values and even switch to the console and evaluate expressions.

The published data you get on the web side is itself a JSON, which is why I call JSON.parse(e.data) in the event handler. You should be able to use parsedData.data as the value you sent from the core–don’t forget it is a string so you can’t do math on it without converting it.

1 Like

So Get_UnixTime is declared static meaning it is local to that file only. I would think that Time.now() is what you wanted instead.

2 Likes

f12 also toggles the Web Dev Console :wink:

2 Likes

@bko is correct, the correct call is Time.now() :smile:

2 Likes