|
-
Nov 22nd, 2000, 07:51 AM
#1
Thread Starter
Hyperactive Member
Anyone know how to display many varations of time ie: secs from 1970 or 11:12:00 etc
-
Nov 22nd, 2000, 08:03 AM
#2
Fanatic Member
Seconds
To get the number of seconds between dates, use DateDiff.
Code:
Private Sub Command1_Click()
MsgBox DateDiff("s", 1 / 1 / 1970, Now)
End Sub
-
Nov 22nd, 2000, 08:09 AM
#3
Fanatic Member
Format
You can also use Format on the date.
Code:
Private Sub Command1_Click()
MsgBox DateDiff("s", 1 / 1 / 1970, Now) & vbCrLf & _
Format(Now, "mm/dd/yy") & vbCrLf & _
Format(Now, "mm/dd/yyyy") & vbCrLf & _
Format(Now, "mm:dd:yy") & vbCrLf & _
Format(Now, "mm:dd:yy hh:mm:ss")
End Sub
-
Nov 22nd, 2000, 08:35 AM
#4
Thread Starter
Hyperactive Member
Thanks for that.
Slight ammendment for those on board
DateDiff("s", #1/1/1970#, Now)
surround the date with #
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|