Time.UnixTimeStamp
------------------

Returns the unix time stamp.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Utility](component_Utility.md) | [3.1](newinversion31.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Time.UnixTimeStamp" { ; TimeStamp; gmt } ) 

**MBS**( **"Time.UnixTimeStamp";** /\* Returns the unix time stamp. \*/  
**$TimeStamp**; /\* Optional; Optional, a FileMaker timestamp to convert.e.g. Get(SystemTimeStamp) \*/   
**$gmt**) /\* Optional; Whether to use GMT as time zone.  
Pass 1 for GMT or 0 for local.  
Not used if you query now, e.g. without a timestamp.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| TimeStamp | Optional, a FileMaker timestamp to convert. | Get(SystemTimeStamp) | Optional |
| gmt | Whether to use GMT as time zone.   Pass 1 for GMT or 0 for local.   Not used if you query now, e.g. without a timestamp. | 0 | Optional      Added in version **10.3**. |

### Result

Returns time stamp as number.

### Description

Returns the unix time stamp.  
If called with no parameters, returns current time stamp (GMT).  
If you pass a timestamp, this timestamp is converted. Be aware that the system timezone is used.  
  
Convert back to FileMaker with [Time.UnixTimeStampToFileMaker](TimeUnixTimeStampToFileMaker.md) function.  
### Examples

Calc current time:

 MBS ( "Time.UnixTimeStamp"; Get(CurrentTimeStamp) )  
<small>  
Example result: 1481452626</small>Calc time for date:

 MBS ( "Time.UnixTimeStamp"; Date ( 5; 5; 1956 ); 0 )  
<small>  
Example result: -431053200</small>Calc time for date in GMT:

 MBS ( "Time.UnixTimeStamp"; Date ( 5; 5; 1956 ); 1 )  
<small>  
Example result: -431049600</small>Calc current time:

 MBS ( "Time.UnixTimeStamp" )  
### See also

- [CURL.SetupOAuth](CURLSetupOAuth.md)
- [Time.UnixTimeStampToFileMaker](TimeUnixTimeStampToFileMaker.md)

### Release notes

- **Version 11.1**
    - Rewrote [Time.UnixTimeStamp](https://www.mbsplugins.eu/TimeUnixTimeStamp.shtml) function to work for dates before 1970 on Windows.
- **Version 10.3**
    - Added gmt parameter for [Time.UnixTimeStamp](https://www.mbsplugins.eu/TimeUnixTimeStamp.shtml) function.
    - Fixed time zone handling for [Time.UnixTimeStamp](https://www.mbsplugins.eu/TimeUnixTimeStamp.shtml) and [Time.UnixTimeStampToFileMaker](https://www.mbsplugins.eu/TimeUnixTimeStampToFileMaker.shtml) functions.
- **Version 8.3**
    - Added [Time.UnixTimeStampToFileMaker](http://www.mbsplugins.eu/TimeUnixTimeStampToFileMaker.shtml) function.

### Example Databases

- [CURL/WebServices/Twitter oAuth](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/WebServices/Twitter%20oAuth.shtml#5ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 11.1pr7](https://www.mbsplugins.de/archive/2021-03-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.3pr2](https://www.mbsplugins.de/archive/2020-06-08/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.3pr2](https://www.mbsplugins.de/archive/2014-07-15/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.2pr7](https://www.mbsplugins.de/archive/2013-04-16/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 26th February 2021

  
[Time.TimeZoneOffset](TimeTimeZoneOffset.md) - [Time.UnixTimeStampToFileMaker](TimeUnixTimeStampToFileMaker.md)

[HTML Version](TimeUnixTimeStamp.shtml)