SQL.ConvertDateTimeFromSQL
--------------------------

Converts a date or timestamp to FileMaker format.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SQL](component_SQL.md) | [11.2](newinversion112.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "SQL.ConvertDateTimeFromSQL"; Value ) 

**MBS**( **"SQL.ConvertDateTimeFromSQL";** /\* Converts a date or timestamp to FileMaker format. \*/  
**$Value**) /\* The text value.e.g. "2008-05-13T06:20:56" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Value | The text value. | "2008-05-13T06:20:56" |

### Result

Returns date, time, timestamp or error.

### Description

Converts a date or timestamp to FileMaker format.  
Localization of FileMaker time and date formats applies. Examples below are in German format.  
This function doesn't do time zones.  
  
If you use SQL record sets, you don't need this function, but [SQL.GetFieldAsTime](SQLGetFieldAsTime.md), [SQL.GetFieldAsDateTime](SQLGetFieldAsDateTime.md), [SQL.GetFieldAsDate](SQLGetFieldAsDate.md), [SQL.GetParamAsTime](SQLGetParamAsTime.md), [SQL.GetParamAsDateTime](SQLGetParamAsDateTime.md) and [SQL.GetParamAsDate](SQLGetParamAsDate.md) do similar conversion for you internally.  
### Examples

Convert time stamp:

 MBS ( "SQL.ConvertDateTimeFromSQL"; "2008-05-13T06:20:56.123456 " )  
<small>  
Example result: 13.05.2008 06:20:56,123456</small>Convert date:

 MBS ( "SQL.ConvertDateTimeFromSQL"; "2008-05-13" )  
<small>  
Example result: 13.05.2008</small>Convert time:

 MBS ( "SQL.ConvertDateTimeFromSQL"; "06:20:56" )  
<small>  
Example result: 06:20:56</small>Convert now:

 MBS ( "SQL.ConvertDateTimeFromSQL"; "now" )  
### See also

- [SQL.ConvertDateTimeToSQL](SQLConvertDateTimeToSQL.md)
- [SQL.GetFieldAsDate](SQLGetFieldAsDate.md)
- [SQL.GetFieldAsDateTime](SQLGetFieldAsDateTime.md)
- [SQL.GetFieldAsTime](SQLGetFieldAsTime.md)
- [SQL.GetParamAsDate](SQLGetParamAsDate.md)
- [SQL.GetParamAsDateTime](SQLGetParamAsDateTime.md)
- [SQL.GetParamAsTime](SQLGetParamAsTime.md)

### Release notes

- **Version 15.4**
    - Fixed a bug in [SQL.ConvertDateTimeFromSQL](https://www.mbsplugins.eu/SQLConvertDateTimeFromSQL.shtml) not returning proper error status.
- **Version 15.2**
    - Fixed [SQL.ConvertDateTimeFromSQL](https://www.mbsplugins.eu/SQLConvertDateTimeFromSQL.shtml) to return empty result if the date value is not valid.
- **Version 11.2**
    - Added milliseconds for [SQL.ConvertDateTimeFromSQL](https://www.mbsplugins.eu/SQLConvertDateTimeFromSQL.shtml) and [SQL.ConvertDateTimeToSQL](https://www.mbsplugins.eu/SQLConvertDateTimeToSQL.shtml) functions.
    - Added [SQL.ConvertDateTimeFromSQL](https://www.mbsplugins.eu/SQLConvertDateTimeFromSQL.shtml) and [SQL.ConvertDateTimeToSQL](https://www.mbsplugins.eu/SQLConvertDateTimeToSQL.shtml) functions.

### Blog Entries

- [MBS FileMaker Plugin, version 15.4pr3](https://www.mbsplugins.de/archive/2025-08-19/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.2pr1](https://www.mbsplugins.de/archive/2025-04-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 11.2](https://www.mbsplugins.de/archive/2021-05-26/New_in_MBS_FileMaker_Plugin_11/monkeybreadsoftware_blog_filemaker)
- [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 11.2pr5](https://www.mbsplugins.de/archive/2021-05-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 27th April 2021 , last changed 8th April 2024

  
[SQL.Connect](SQLConnect.md) - [SQL.ConvertDateTimeToSQL](SQLConvertDateTimeToSQL.md)

[HTML Version](SQLConvertDateTimeFromSQL.shtml)