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

JS.TimeToUTCDate

Converts time value to timestamp.

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

Parameters

Parameter Description Example value
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.Free"; ~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

Blog Entries

Release notes

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


JS.TimeToDateComponents   -   JS.UTCDateToTime

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins