VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A1 Sec2Min

by roy (2 Submissions)
Category: Math/Dates
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (7 Votes)

Convert seconds to minutes with just one line of code. I was encouraged to submit this after seeing where some guy had submitted 50 or so lines of code to do the same thing. This can be expanded to return hours, just follow the logic.

Rate A1 Sec2Min

Dim lSecs As Long
Dim sMin As String
  
lSecs = 120
sMin = Format(Fix(lSecs / 60), "#0") & _
  ":" & Format(lSecs Mod 60, "00")
MsgBox sMin

Download this snippet    Add to My Saved Code

A1 Sec2Min Comments

No comments have been posted about A1 Sec2Min. Why not be the first to post a comment about A1 Sec2Min.

Post your comment

Subject:
Message:
0/1000 characters