Download MetaTrader 5
To add comments, please log in or register
Publish your article to let the traders see it in MetaTrader 5!
Pierre Rougier
386
Pierre Rougier 2014.02.22 15:48 
Hello,

With this script:

//+------------------------------------------------------------------+
//|                                                   spDateTime.mq4 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   datetime d1=D'1980.01.01 00:00:00';
   Print("d1 :"+TimeToString(d1),TIME_DATE|TIME_SECONDS);
  }
//+------------------------------------------------------------------+

I expect that:

2014.02.22 16:33:09.483 spDateTime2 GOLD Weekly: d1: 1980.01.01 00:000

And I get this:

2014.02.22 16:33:09.483 spDateTime2 GOLD Weekly: d1: 1980.01.01 00:005

Can someone explain to me?

whroeder1
13644
whroeder1 2014.02.22 17:34  
Report it do the Service Desk
I missed the parenthese.
Alain Verleyen
Moderator
28672
Alain Verleyen 2014.02.23 09:48  
tintin92:
Hello,

With this script:

I expect that:

And I get this:

Can someone explain to me?

You misplaced you parenthesis, try this way :

   datetime d1=D'1980.01.01 00:00:00';
   Print("d1 :"+TimeToString(d1,TIME_DATE|TIME_SECONDS));
Pierre Rougier
386
Pierre Rougier 2014.02.24 19:33  
Thanks
/
To add comments, please log in or register