Setting date and time by script
Posted: Fri Oct 07, 2011 9:40 am
Hi. I would like to set iXPanel date and time by script.
I have written this simply code:
void Data()
{
System.DateTime dt=new DateTime();
dt.AddYears(2011);
dt.AddMonths(10);
dt.AddDays(3);
dt.AddHours(8);
dt.AddMinutes(0);
dt.AddSeconds(0);
Neo.ApplicationFramework.Common.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IDateTimeEditService>().SetSystemDateTime(dt);
}
but when I run it, a "Set Date/Time Failed" dialog window appears.
Could you help me?
Thank you!
I have written this simply code:
void Data()
{
System.DateTime dt=new DateTime();
dt.AddYears(2011);
dt.AddMonths(10);
dt.AddDays(3);
dt.AddHours(8);
dt.AddMinutes(0);
dt.AddSeconds(0);
Neo.ApplicationFramework.Common.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IDateTimeEditService>().SetSystemDateTime(dt);
}
but when I run it, a "Set Date/Time Failed" dialog window appears.
Could you help me?
Thank you!