CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Date Problem

  1. #1
    Guest

    Date Problem

    Hi,

    how can I set a specific Date/Time to a Date DataType?

    Dim myDate as Date


    dim d, m, y, min, h, s as integer

    'Month:

    d = 25
    m = 6
    y = 1981
    'Time:

    min = 59
    s = 59
    h = 23

    'Need some Code to set myDate to the Date #min/d/y h:m:s# (with the Variables, of course)

    Sebastian




  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: Date Problem

    Try:
    myDate = DateSerial(y, m, d) + TimeSerial(h, Min, s)
    'or
    myDate = CDate(y & "/" & m & "/" & d & " " & h & ":" & Min & ":" & s)



    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Certified AllExperts Expert: http://www.allexperts.com/displayExp...p?Expert=11884
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured