JS.UTCDateToTime
----------------

Converts date to time value.

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

MBS( "JS.UTCDateToTime"; JSRef; TS ) 

**MBS**( **"JS.UTCDateToTime";** /\* Converts date to time value. \*/  
**$JSRef**; /\* The JavaScript reference number.e.g. $js \*/   
**$TS**) /\* The timestamp to convert.  
Must be in UTC timezone. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| JSRef | The JavaScript reference number. | $js |
| TS | The timestamp to convert.   Must be in UTC timezone. |  |

### Result

Returns double or error.

### Description

Converts date to time value.  
Convert components (year, month, day, hour, minute, seconds) in timestamp, interpreted in UTC, into a time value.  
### Examples

Tests [time](component_Time.md) functions:

 Let(\[  
c = MBS ( "[JS.New](JSNew.md)" );  
r = MBS ( "JS.UTCDateToTime"; c; Get(CurrentTimeStamp) );  
d = MBS ( "[JS.TimeToDateComponents](JSTimeToDateComponents.md)"; c; r )  
\]; r &amp; ¶ &amp; d)  
<small>  
Example result:   
1582121231000  
{  
 "year": 2020,  
 "month": 2,  
 "day": 19,  
 "hours": 14,  
 "minutes": 7,  
 "seconds": 11,  
 "milliseconds": 0,  
 "weekday": 3,  
 "timezone": "UTC",  
 "weekdayText": "Wednesday"  
}</small>### See also

- [JS.New](JSNew.md)
- [JS.TimeToDateComponents](JSTimeToDateComponents.md)

### Release notes

- **Version 11.2**
    - Added milliseconds for timestamps in [JS.TimeToUTCDate](https://www.mbsplugins.eu/JSTimeToUTCDate.shtml) and [JS.UTCDateToTime](https://www.mbsplugins.eu/JSUTCDateToTime.shtml) functions.
- **Version 10.4**
    - Fixed month for [JS.UTCDateToTime](https://www.mbsplugins.eu/JSUTCDateToTime.shtml) function.
- **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

- [MBS FileMaker Plugin, version 11.2pr6](https://www.mbsplugins.de/archive/2021-05-04/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.4pr5](https://www.mbsplugins.de/archive/2020-08-24/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [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.TimeToUTCDate](JSTimeToUTCDate.md) - [JSON.AddArrayToArray](JSONAddArrayToArray.md)

[HTML Version](JSUTCDateToTime.shtml)