Skip to content

Hour, minute, second round issue #4

Description

@elmancox

function timestamp(duration)
local hours = duration / 3600
local minutes = duration % 3600 / 60
local seconds = duration % 60
return string.format("%02d:%02d:%02.03f", hours, minutes, seconds)
end

if you start a cut between 30 and 59 seconds, this will show 00:01:30.xxx instead of 00:00:30.xxx
You have to add math.floor() to hours and minutes i think.
Something like this:

function timestamp(duration)
local hours = math.floor(duration / 3600)
local minutes = math.floor(duration % 3600 / 60)
local seconds = duration % 60
return string.format("%02d:%02d:%02.03f", hours, minutes, seconds)
end

Activity

  1. Repository owner deleted a comment from ValdikSS on Feb 11, 2019
  2. added a commit that references this issue on Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions