Announcement

Collapse
No announcement yet.

vb.net todatetime

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • vb.net todatetime

    Hi all,

    Just putting together a liitle tool to insert appointments into outlook calendar,
    all working except the start and end times... I cant figure this out.

    excerpt from MS VB.net example
    oAppt.Start = Convert.ToDateTime("11/30/2001 9:00:00 AM")
    oAppt.End = Convert.ToDateTime("11/30/2001 1:00:00 PM")

    Anyone done the Convert.todatetime thing before in PB ?

    Cheers,
    N

  • #2
    OK, I can see that oAppt.Start and .End are expecting a DW but how to
    convert ???

    Comment


    • #3
      Can not be a dword, it contains time as well.

      In .net .ToOaDate() will convert to double.

      See also:

      http://www.powerbasic.com/support/fo...ML/014463.html
      hellobasic

      Comment


      • #4
        Besides.. this is a much better way to create a datetime object (c#):

        DateTime d = new DateTime(2007, 1, 12, 19, 22, 11);
        hellobasic

        Comment


        • #5
          THX Edwin, I meant double
          but how do I convert this in PB ?

          Comment


          • #6
            see link above?
            hellobasic

            Comment


            • #7
              Edwin,
              Checked link out and using SystemTimeToVariantTime did not work.
              However I have done some more digging and while the VB.net example
              converts the date/time to a double the VBA code i found does not.
              This works perfectly

              vStart = "13/12/2007 3:04:00 PM"
              vEnd = "13/12/2007 3:19:00 PM"

              no conversion required. :-)

              Thanks for your help.
              N.

              Comment

              Working...
              X