Developer   API   Core & System   Date

  •  Config(0)
  •  Properties(17)
  •  Methods(17)
  •  Events(0)

Date(native)

Represents date and time. Local and UTC timezones supported.

Example

// Now var d = new Date(); console.printf("today is: %d-%d-%d %d:%d:%d\n", d.day, d.month, d.year, d.hour, d.minute, d.second); // UTC d = new Date("28 Feb 1980 UTC"); if (d.UTCday != 28 || f.UTCmonth != 2 || d.UTCyear != 1980) throw "date ctor"; // Locale strings console << d.toLocaleString(true, 1);

Properties

  • day : Integer
    Number of the day, from 1 up to number of days in current month.
  • dayOfWeek : Integer
    Day of the week, number of day of the week, from 0 to 6 where 0 is Monday.
  • firstDayOfWeek : Integer
    First day of the week in current locale, from 0 to 6 where 0 is Monday.
  • hour : Integer
    Hour, from 0 to 23.
  • millisecond : Integer
    Millisecond, from 0 to 999.
  • minute : Integer
    Minute, from 0 to 59.
  • month : Integer
    Number of the month, from 1 to 12.
  • second : Integer
    Second, from 0 to 59.
  • UTCday : Integer
    UTCday, number of the day, from 1 up to number of days in current month.
  • UTCdayOfWeek : Integer
    UTCdayOfWeek, number of day of the week, from 0 to 6 where 0 is Monday.
  • UTChour : Integer
    UTChour, hour, from 0 to 23.
  • UTCmillisecond : Integer
    UTCmillisecond, integer, millisecond, from 0 to 999.
  • UTCminute : Integer
    UTCminute, minute, from 0 to 59.
  • UTCmonth : Integer
    UTCmonth, number of the month, from 1 to 12.
  • UTCsecond : Integer
    UTCsecond, second, from 0 to 59.
  • UTCyear : Integer
    UTCyear, full number of the year, e.g. 2005.
  • year : Integer
    Full number of the year, e.g. 2012.

Methods

  • dayOfWeekName(longFormat) : String
    Find out name of the day in current user's locale.
  • isDaylight() : Boolean
    Find out if current clock is using daylight saving time.
  • monthName(longFormat) : String
    Find out name of the month in current user's locale.
  • now(sequential = false) : Date
    Function for getting the current time in UTC.
  • parse(value) : Boolean
    This function parse date in string
  • setTime(milliseconds) : Date
    Sets this date object fields equal to date defined by milliseconds parameter.
  • this([year, month, day[, hour[, minute[, second[, millisecond]]]]]]) : Date
    Constructor - creates new date object. If no parameters were given then initializes date fields to the current time (UTC). If year, month, day, etc. provided uses these numeric values to initialize new Date instance.
  • this([value]) : Date
    Constructor - creates new date object. If no parameters were given then initializes date fields to the current time (UTC). If single string parameter provided then parses date contained in the string.
  • tick() : Integer
    Number of miliseconds. This property is suitable for animation (game) scheduling.
  • timeZoneName() : String
    Returns name of current timezone.
  • timeZoneOffset() : Integer
    Returns shift in milliseconds of current timezone from GMT.
  • toISOString(asUTC = false) : String
    Creates ISO 8601 string representation of this date object as either local or UTC date/time.
  • toLocaleString(longFormat, typeFormat) : String
    Returns string representation of the date using current system settings. Argument typeFormat can by one of:
  • toString() : T:String
    Creates RFC-822 string representation of this date object.
  • toUTCString() : String
    Creates RFC-822 string representation of this date object as UTC date/time.
  • UTC(year, month, day [, hour [, minute [, second [, millisecond ]]]]]) : Boolean
    Calculate number of milliseconds since midnight, January 1, 1970 UTC up to date defined by parameters
  • valueOf() : Float
    Calculate number o milliseconds since midnight, January 1, 1970 UTC.
API Navigation
Skip Navigation Links.
Expand <span>User Interface</span> User Interface
Collapse <span>Core & System</span> Core & System
System
Object
Integer
Float
String
Date
Math
Array
RegExp
Global
Function
Timer
Expand <span>Graphics</span> Graphics
Expand <span>Files and Databases</span> Files and Databases
Expand <span>Crypto</span> Crypto
Expand <span>Native User Interface</span> Native User Interface
Expand <span>Net</span> Net
Expand <span>Media</span> Media
Expand <span>Sensor</span> Sensor
Expand <span>Game Development</span> Game Development