Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
JS.TimeToUTCDate
Converts time value to timestamp.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
JavaScript | 10.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "JS.TimeToUTCDate"; JSRef; Time ) More
Parameters
Parameter | Description | Example |
---|---|---|
JSRef | The JavaScript reference number. | $js |
Time | The time value. | 1579438861538 |
Result
Returns timestamp or error.
Description
Converts time value to timestamp.Examples
Query now as timestamp:
MBS( "JS.TimeToUTCDate"; $$JS; MBS( "JS.Now"; $$JS ))
Example result: 19.01.2020 12:59:46
Query time in JavaScript, convert to UTC and format in FileMaker:
Let (
[
~js = MBS( "JS.New" );
~fmTime = MBS( "JS.TimeToUTCDate"; ~js ; MBS( "JS.Now"; ~js ));
~releasejs = MBS( "JS.Release"; ~js )
];
MBS( "Time.Format"; ~fmTime ; "%a, %d %b %Y %H:%M:%S") & " GMT"
)
Example result: "Wed, 03 Jun 2020 07:12:17 GMT"
See also
Release notes
- Version 11.2
- Added milliseconds for timestamps in JS.TimeToUTCDate and JS.UTCDateToTime functions.
- Version 10.1
- Added time functions for JavaScript functions: JS.Now, JS.TimeToDateComponents, JS.TimeToUTCDate and JS.UTCDateToTime.
Blog Entries
- MBS FileMaker Plugin, version 11.2pr6
- New in the MBS FileMaker Plugin 10.1
- MBS FileMaker Plugin, version 10.1pr1
This function checks for a license.
Created 19th January 2020, last changed 29th October 2020