Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.5   9.0   9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2    Statistic  

JS.TimeToDateComponents

Converts time to date components.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
JavaScript 10.1 Yes Yes Yes Yes Yes
MBS( "JS.TimeToDateComponents"; JSRef; Time )   More

Parameters

Parameter Description Example value
JSRef The JavaScript reference number. $js
Time The time value. 1579438861538

Result

Returns JSON or error.

Description

Converts time to date components.
Convert a time value to components (year, month, day, hour, minute, second) interpreted in UTC. If the time value is invalid, e.g. beyond the valid ECMAScript time range, an error is thrown.

Examples

Query date components for now:

MBS( "JS.TimeToDateComponents"; $$JS; MBS( "JS.Now"; $$JS ))

Example result:
{
  "year":   2020,
  "month":   1,
  "day":   19,
  "hours":   12,
  "minutes":   59,
  "seconds":   13,
  "milliseconds":   806,
  "weekday":   0,
  "timezone":   "UTC",
  "weekdayText":   "Sunday"
}

See also

Blog Entries

Release notes

Created 19th January 2020, last changed 19th January 2020


JS.StringCount   -   JS.TimeToUTCDate

Feedback: Report problem or ask question.




Links
MBS FileMaker blog