# GlobalVariableTime Returns the time when the global variable was last accessed. ``` datetime  GlobalVariableTime(    string  name      // name    ); ``` Parameters name [in]  Name of the global variable. Return Value The function returns time of last accessing the specified global variable. Addressing a variable for its value, for example using the [GlobalVariableGet()](/en/docs/globals/globalvariableget) and [GlobalVariableCheck()](/en/docs/globals/globalvariablecheck) functions, also modifies the time of last access. In order to obtain [error](/en/docs/constants/errorswarnings/errorcodes) details, call the [GetLastError()](/en/docs/check/getlasterror) function. Note Global variables exist in the client terminal during 4 weeks since they were called last. After that they are automatically deleted. Example: ``` #property copyright "Copyright 2025, MetaQuotes Ltd." #property link      "https://www.mql5.com" #property version   "1.00"   #define   GV_NAME    "TestGlobalVariableTime" #define   GV_TOTAL   5   //+------------------------------------------------------------------+ //| Script program start function                                    | //+------------------------------------------------------------------+ void OnStart()   { //--- delete the global variables of the client terminal with the GV_NAME prefix created for the test    GlobalVariablesDeleteAll(GV_NAME);     //--- create client terminal global variables in the amount of GV_TOTAL //--- with the GV_NAME prefix and the 5-second pause between the creation of each one    for(int i=0; i