Seconds to Minutes

Results 1 to 2 of 2

Thread: Seconds to Minutes

  1. #1
    Whaz Up Guest

    Default Seconds to Minutes

    how can i format text that i can get from seconds minutes<BR>so if i have 250 i have to show it like 4:10 min<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Seconds to Minutes

    The following will work but I&#039d like to know if there is a simpler way:<BR>&#060;%<BR>Dim sectime, secs, mins, mintime, pointpos<BR>sectime = 250<BR>mintime = sectime/60<BR>pointpos = InStr(mintime, ".")<BR>If pointpos&#060;&#062;0 Then<BR> mins = Left(mintime, pointpos-1)<BR>Else <BR> mins = mintime<BR>End If<BR>secs = (sectime Mod 60)<BR>If secs&#060;&#062;0 Then<BR> Response.Write mins &":"& secs <BR>Else<BR> Response.Write mins &":0"& secs <BR>End If<BR>%&#062;

Posting Permissions

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