Page 1 of 1

Why are DateTime variables truncated to the date?

Posted: Thu Dec 11, 2008 9:35 am
by Tobias
When adding a DateTime variable like this:

Code: Select all

stiReport.Dictionary.Variables.Add("Variables", "DateTime1", "Date / Time", DateTime.Now);
then it is converted to a ShortDateString and back to DateTime, so that the time information get's lost. I've checked this in the source and it seem to be done be intend. But why? It doesn't seem to make any sense to me, to strip off the time from a DateTime variable.

And the workaround is kinda ugly:

Code: Select all

stiReport.Dictionary.Variables.Add("Variables", "DateTime2", "Date / Time", typeof(DateTime), DateTime.Now.ToString("yyyy-MM-dd HH:mm tt"), false);
...just curious,

Tobias

Why are DateTime variables truncated to the date?

Posted: Sat Dec 13, 2008 12:04 am
by Vital
Hello Tobias,

Problem fixed. Patch will be available in build from 15 Dec.

Thank you.