Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Excerpt

A few constants to make working with times more semantic...

 

Months

The following constants can be used when working with the Javascript Date object, to specify a specific month:

  • JAN, JANUARY
  • FEB, FEBRUARY
  • MAR, MARCH
  • APR, APRIL
  • MAY
  • JUN, JUNE
  • JUL, JULY
  • AUG, AUGUST
  • SEP, SEPTEMBER
  • OCT, OCTOBER
  • NOV, NOVEMBER
  • DEC, DECEMBER

Millisecond conversions

If you're working in milliseconds, these constants are useful:

  • SECONDS – SECONDS – eg. 12*SECONDS would give a value of 12000 milliseconds
  • MINUTES – MINUTES – eg. 5*MINUTES would give a value of 300000 milliseconds
  • HOURS – eg. 1*HOURS would give a value of 3600000 milliseconds

Second conversions

If you're working in seconds, these constants are useful:

  • SECS – SECS – eg. 12*SECS would give a value of 12 seconds.
  • MINS – MINS – eg. 5*MINS would give a value of 300 seconds
  • HRS – eg. 1*HRS would give a value of 3600 seconds

Notes

In Warzone 3.1, setMissionTime() and setReinforcementTime() used time units of 1/10th of a second, which sounds odd until you realise that's the interval of a game tick and also the update rate of gameTime. It was very confusing unit to work with, so in Warzone 3.2 such the functions were updated to use seconds instead.

Div
classbox
Availability
Status
colourYellow
titleBeta

Requires:

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Milliseconds:

  • now – get current real-world time specified in milliseconds
  • setTimer() – call a function on a repeating interval specified in milliseconds
  • queue() – call a function after a delay specified in milliseconds

Seconds: