IT
Information
Username: | itaiophir |
Member since: | 19 Apr 2014 |
Last login: | 19 Apr 2014 |
Status: | Active |
Activity
Where | Created | Comments |
---|---|---|
Algorithms | 0 | 3 |
Forum Topics | 5 | 4 |
Jobs | 0 | 0 |
Last Algorithm Comments
IT
Hi Mark,
And thanks for this, but - i'm getting this error on the log:
"07/06/2014 12:33:31.483 | Error parsing datetime 08/06/2014 12:33:30 Sun Jun 8 "
I looked on the file downloaded form the site, and all the dates are like that ("Sun Jun 8 ").
I'm guessing, this is probably a problem with the date format. Any idea??
thanks,
Itai
IT
Hi there,
this indicator looks good and i would like to use within a cBot.
i'm trying to understand what is the "index" parameter used in methods in order to re-write the code.
how can you help me with that?
thanks,
Itai
Hi,
for anyone who has the problem i had, you can replace the below function with the below script. that should do the work.
private DateTime GetDateTime(DateTime fileDate, string dateStr, string timeStr)
{
try
{
string strDateStarted = dateStr + " " + timeStr + " 2014";
DateTime result;
DateTime.TryParseExact(strDateStarted, new string[]
{
"ddd MMM dd HH:mm yyyy"
}, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out result);
return result;
} catch (Exception e)
{
_logger.Log("Error parsing datetime {0} {1} {2}", fileDate, dateStr, timeStr);
_logger.Log(e.Message);
throw;
}
}