Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Setting date and time by script
PostPosted: Fri Oct 07, 2011 9:40 am 

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

Offline
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!


 Profile  
 
 Post subject: Re: Setting date and time by script
PostPosted: Mon Oct 10, 2011 9:36 am 
User avatar

Joined: Fri Jul 15, 2011 3:21 pm
Posts: 214

Offline
Here's is an example project with script to set the date/time.


Attachments:
DateTimeController.zip [21.51 KiB]
Downloaded 614 times

_________________
Best Regards,

Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
 Profile  
 
 Post subject: Re: Setting date and time by script
PostPosted: Tue Oct 11, 2011 12:46 am 

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

Offline
Thank you.
Best regards


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron