Results 1 to 2 of 2

Thread: Converting to UNIX times

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    Leeds W Yorks
    Posts
    1
    Good day, I'm looking for anybody who has seen or written a function that converts a normal VB6 Date to the UNIX data format. I believe the format is the number of seconds since 1970??
    Thanks

  2. #2
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    Thought I would make you laugh and roll your eyes

    Dim b As Variant
    Dim c As Variant
    Dim d As Long

    c = 60 * 60
    c = c * 24

    d = ((Format(Now, "yyyy") - 1971)) * 365

    Do Until Format(Now - d, "yyyymmdd") = "19700101"
    d = d + 1
    Loop

    c = d * c

    b = (Format(Now, "hh:mm:ss"))
    b = ((Val(Left$(b, 2) * 60) + Val(Mid(b, 4, 2))) * 60) + Val(Mid(b, 7, 2))


    MsgBox Val(c) + Val(b)
    Kurt Simons
    [I know I'm a hack but my clients don't!]

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