Results 1 to 5 of 5

Thread: [RESOLVED] converting custom date/time value

Hybrid View

  1. #1
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: converting custom date/time value

    This should help:

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4. Dim x As Integer
    5. Dim strdatetime As String
    6. strdatetime = "10-Dec-05 08:50:25.000"
    7. MsgBox (strdatetime)   'gives me 10-Dec-05 08:50:25.000
    8. x = InStrRev(strdatetime, ".") - 1
    9. If x > 0 Then
    10.  strdatetime = Left(strdatetime, x)
    11. End If
    12. MsgBox Format(strdatetime, "dd-mmm-yy hh:mm:ss")
    13. End Sub

  2. #2

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    4

    Thumbs up Re: converting custom date/time value

    Thanks very much. That was just was I needed.

    Cheers,
    Carl

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