Setting date and time by script

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
Hi-Volt
Posts: 29
Joined: Mon Sep 12, 2011 4:52 am

Setting date and time by script

Post by Hi-Volt »

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!

User avatar
Ron L.
Posts: 214
Joined: Fri Jul 15, 2011 3:21 pm

Re: Setting date and time by script

Post by Ron L. »

Here's is an example project with script to set the date/time.
Attachments
DateTimeController.zip
(21.51 KiB) Downloaded 1674 times
Best Regards,

Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer

Hi-Volt
Posts: 29
Joined: Mon Sep 12, 2011 4:52 am

Re: Setting date and time by script

Post by Hi-Volt »

Thank you.
Best regards

lae17578
Posts: 3
Joined: Tue Nov 08, 2016 2:59 am

Re: Setting date and time by script

Post by lae17578 »

Has anyone got this to work? With a T7B screen the coredll.dll isnt there?

Post Reply