CURL.GetFileTime
----------------

Get the remote time of the retrieved document.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [2.5](newinversion25.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.GetFileTime"; curl ) 

**MBS**( **"CURL.GetFileTime";** /\* Get the remote time of the retrieved document. \*/  
**$curl**) /\* The CURL session handle. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |

### Result

Returns the requested value or nothing on error.

### Description

Get the remote time of the retrieved document.  
If you get an empty result, it can be because of many reasons (unknown, the server hides it or the server doesn't support the command that tells document time etc) and the time of the document is unknown. Note that you must tell the server to collect this information before the transfer is made, by using the [CURL.SetOptionFileTime](CURLSetOptionFileTime.md) or you will unconditionally get an empty result back.   
  
e.g. "28.02.2013 16:43:55"  
### Examples

Try getting the file time:

 Set Variable \[ $curl ; Value: MBS ("[CURL.New](CURLNew.md)") \]  
\# put in some URL   
Set Variable \[ $r ; Value: MBS ("[CURL.SetOptionURL](CURLSetOptionURL.md)"; $curl ; "https://www.monkeybreadsoftware.com/filemaker/examples/test.txt") \]  
\# Only check if file exists, but don't download it   
Set Variable \[ $result ; Value: MBS ("[CURL.SetOptionNoBody](CURLSetOptionNoBody.md)"; $curl ; 1) \]  
\# Request to read file time   
Set Variable \[ $r ; Value: MBS ("[CURL.SetOptionFileTime](CURLSetOptionFileTime.md)"; $curl ; 1) \]  
\# perform request   
Set Variable \[ $result ; Value: MBS ("[CURL.Perform](CURLPerform.md)"; $curl ) \]  
\#   
\# check result   
Set Field \[ CURL Test::Debug Messages ; MBS ("[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl ) \]  
\# check response code: 200 if file exists or 404 if not found   
Set Variable \[ $responseCode ; Value: MBS ("[CURL.GetResponseCode](CURLGetResponseCode.md)"; $curl ) \]  
\# and get the time value   
Set Variable \[ $time ; Value: MBS ("CURL.GetFileTime"; $curl ) \]  
\# cleanup   
Set Variable \[ $result ; Value: MBS ("[CURL.Release](CURLRelease.md)"; $curl ) \]  
### See also

- [CURL.GetDebugMessages](CURLGetDebugMessages.md)
- [CURL.GetResponseCode](CURLGetResponseCode.md)
- [CURL.New](CURLNew.md)
- [CURL.Perform](CURLPerform.md)
- [CURL.Release](CURLRelease.md)
- [CURL.SetOptionFileTime](CURLSetOptionFileTime.md)
- [CURL.SetOptionNoBody](CURLSetOptionNoBody.md)
- [CURL.SetOptionURL](CURLSetOptionURL.md)

### Example Databases

- [CURL/CURL Download Picture](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20Picture.shtml#1ScriptAnchor_)

This function checks for a license.

Created 18th August 2014 , last changed 22nd February 2026

  
[CURL.GetFailedScriptName](CURLGetFailedScriptName.md) - [CURL.GetFinishedEvaluate](CURLGetFinishedEvaluate.md)

[HTML Version](CURLGetFileTime.shtml)