Issue converting number to correct date and time

Posted on 2006-04-05
Last Modified: 2010-04-23
I have some information coming in from a field device, which takes readings every five seconds. The time stamps are loaded into a integer array, with of course 5 second intervals which correspond to a temperature reading that I have also received. What I need to to is to be able to is pick a date/time from a calender function, then have the app place the correct date/time stamp into an array for me to use in a graph. Is this possible?


Question by:bradbritton
    LVL 14

    Expert Comment

    Yes :D
    LVL 14

    Accepted Solution

    Well, you might create a class :

    Class CMeasurements

    Give it a property dtmStart As Date

    Init that with your real date.
    Now create a structure

    Structure Data
        Public TimeOffset As Integer
        Public MeasureValue As Double

    End Structure

    Create an arrayList of items of that structure type...

     Now when you're creating the food for your graph:
    Get the real date/time by
    Dim myDataItem as Data <--- was filled before, I just show the type here
    Dim measurements as CMeasurements <-- created before
    dim realDate as Date = measurements.AddSeconds(myDataItem.TimeOffset)

    Something like that.....


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now