Time.TimeStampToUTC
-------------------

Converts timestamp to UTC.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Time](component_Time.md) | [6.1](newinversion61.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Time.TimeStampToUTC"; TimeStamp { ; AsText } ) 

**MBS**( **"Time.TimeStampToUTC";** /\* Converts timestamp to UTC. \*/  
**$TimeStamp**; /\* The input time stamp in local time zone. \*/   
**$AsText**) /\* Optional; Boolean to decide whether to pass back timestamp (0, default) or text (1).e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| TimeStamp | The input time stamp in local time zone. |  |  |
| AsText | Boolean to decide whether to pass back timestamp (0, default) or text (1). | 1 | Optional |

### Result

Returns value or error.

### Description

Converts timestamp to UTC.  
Returns either timestamp in UTC (by removing time zone offset) or as text in format like this: 2014-08-18T12:00:00Z.  
### Examples

Convert local time to UTC:

 MBS ( "Time.TimeStampToUTC"; Get(CurrentTimeStamp) )  
<small>  
Example result: 11.12.2016 10:36:44</small>Convert time to UTC text:

 MBS ( "Time.TimeStampToUTC"; Get(CurrentTimeStamp); 1 )  
<small>  
Example result: 2016-12-11T10:36:50Z</small>### Release notes

- **Version 11.3**
    - Fixed a problem with a [math](https://www.mbsplugins.eu/component_Math.shtml) function, which affected time zone calculation for [EmailParser.SentDate](https://www.mbsplugins.eu/EmailParserSentDate.shtml), [EmailParser.ReceiveDate](https://www.mbsplugins.eu/EmailParserReceiveDate.shtml) and [Time.TimeStampToUTC](https://www.mbsplugins.eu/TimeTimeStampToUTC.shtml) functions (broken in v11.2).
- **Version 10.4**
    - Fixed time zone issue in [Time.TimeStampToUTC](https://www.mbsplugins.eu/TimeTimeStampToUTC.shtml) with Windows with daylight saving.
- **Version 9.1**
    - Fixed bug for [Time.TimeStampToUTC](http://www.mbsplugins.eu/TimeTimeStampToUTC.shtml) on Windows with day change.

### Blog Entries

- [MBS FileMaker Plugin, version 11.3pr2](https://www.mbsplugins.de/archive/2021-06-09/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.4pr6](https://www.mbsplugins.de/archive/2020-08-28/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.1pr4](https://www.mbsplugins.de/archive/2019-02-25/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 6th February 2016 , last changed 9th November 2021

  
[Time.Sleep](TimeSleep.md) - [Time.TimeZoneOffset](TimeTimeZoneOffset.md)

[HTML Version](TimeTimeStampToUTC.shtml)