1
0
Fork 0
forked from e187038/SP_GVA1
SP_GVA1/SP_Pedro1/Homework1/SP_Pedro_Time.mq5
super.admin 066c2f4791 convert
2025-05-30 16:25:41 +02:00

49 lines
1.9 KiB
MQL5

//+------------------------------------------------------------------+
//| SP_Pedro_Time.mq5 |
//| Copyright 2024, MetaQuotes Ltd. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, MetaQuotes Ltd."
#property link "https://www.mql5.com"
#property version "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
// Obtener el tiempo del servidor de trading en segundos
int serverTime = TimeTradeServer();
// Imprimir el tiempo en la consola del terminal
Print("Segundos transcurridos desde el 1 de enero de 1970: ", serverTime);
// Convertir el tiempo en segundos a formato de fecha y hora
string formattedTime = TimeToString(serverTime);
// Imprimir la fecha y hora en la consola del terminal
Print("Fecha y hora actual: ", formattedTime);
// Obtener la fecha y hora actual
//datetime currentTime = TimeCurrent();
}
//+------------------------------------------------------------------+