YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Convert PI-Time String to .NET Date Options · View
be.sule
#1 Posted : Monday, February 21, 2011 2:05:44 PM
Rank: Newbie
Groups: Member

Joined: 2/15/2011
Posts: 7
Hello,

does anyone have an idea if there is a possibility to convert a PI-Time as String (like "*", "*-8h", ...) into a .NET Date?

I'm coding an VB.NET addin in VS2008 and i want to use for my addin the time of the active display. But I need a possibility to
convert the StartTime and EndTime property to something useful in my addin.

thx

Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
RJK Solutions
#2 Posted : Tuesday, February 22, 2011 10:55:40 AM
Rank: Administration

Groups: Administration

Joined: 6/20/2008
Posts: 617
Location: Cheshire, United Kingdom.
Hello,

You sure can, check out the "PITimeFormat" object from the "PITimeServer" type library.

Code:

Dim PTF As New PITimeServer.PITimeFormat()
PTF.InputString = "*-8h"

Dim DT As DateTime = PTF.LocalDate


If you are working across time zones then also check out the "PITimeZoneInfo" object, which is a property of the "PITimeFormat" object.
Principal Consultant
Real-Time Data Management @ Wipro Technologies
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.