JS.TimeToDateComponents
-----------------------

Converts time to date components.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [JavaScript](component_JavaScript.md) | [10.1](newinversion101.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "JS.TimeToDateComponents"; JSRef; Time ) 

**MBS**( **"JS.TimeToDateComponents";** /\* Converts time to date components. \*/  
**$JSRef**; /\* The JavaScript reference number.e.g. $js \*/   
**$Time**) /\* The time value.e.g. 1579438861538 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| 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](JSNow.md)"; $$JS ))  
<small>  
Example result:   
{ "year" : 2020 , "month" : 1 , "day" : 19 , "hours" : 12 , "minutes" : 59 , "seconds" : 13 , "milliseconds" : 806 , "weekday" : 0 , "timezone" : "UTC" , "weekdayText" : "Sunday" } </small>### See also

- [JS.Now](JSNow.md)
- [JS.UTCDateToTime](JSUTCDateToTime.md)

### Release notes

- **Version 10.1**
    - Added [time](https://www.mbsplugins.eu/component_Time.shtml) functions for [JavaScript](https://www.mbsplugins.eu/component_JavaScript.shtml) functions: [JS.Now](https://www.mbsplugins.eu/JSNow.shtml), [JS.TimeToDateComponents](https://www.mbsplugins.eu/JSTimeToDateComponents.shtml), [JS.TimeToUTCDate](https://www.mbsplugins.eu/JSTimeToUTCDate.shtml) and [JS.UTCDateToTime](https://www.mbsplugins.eu/JSUTCDateToTime.shtml).

### Blog Entries

- [New in the MBS FileMaker Plugin 10.1](https://www.mbsplugins.de/archive/2020-03-17/New_in_the_MBS_FileMaker_Plugi/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.1pr1](https://www.mbsplugins.de/archive/2020-01-30/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

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

  
[JS.StringCount](JSStringCount.md) - [JS.TimeToUTCDate](JSTimeToUTCDate.md)

[HTML Version](JSTimeToDateComponents.shtml)