Skip to content

Instantly share code, notes, and snippets.

@barezina
Last active April 16, 2026 11:41
Show Gist options
  • Select an option

  • Save barezina/ecdb29f005fb1712901189335249ca98 to your computer and use it in GitHub Desktop.

Select an option

Save barezina/ecdb29f005fb1712901189335249ca98 to your computer and use it in GitHub Desktop.
davinci resolve dates >> comments (source tape bug)
# lua - use this code for the date created column
pm = resolve:GetProjectManager()
proj = pm:GetCurrentProject()
mp = proj:GetMediaPool()
bin = mp:GetCurrentFolder()
print("in bin", bin:GetName())
clips = bin:GetClips()
for i, clip in pairs(clips) do
local propDate = clip:GetClipProperty("Date Created")
print(propDate)
-- Example format: "Mon Apr 15 2026 14:30:45"
local dayName, monthStr, day, year, hour, min, sec =
string.match(propDate, "(%a+) (%a+) (%d+) (%d+) (%d+):(%d+):(%d+)")
local months = {
Jan = 1, Feb = 2, Mar = 3, Apr = 4,
May = 5, Jun = 6, Jul = 7, Aug = 8,
Sep = 9, Oct = 10, Nov = 11, Dec = 12
}
if dayName and monthStr then
local timestamp = os.time({
year = tonumber(year),
month = months[monthStr],
day = tonumber(day),
hour = tonumber(hour),
min = tonumber(min),
sec = tonumber(sec)
})
local unix_timestamp = tostring(timestamp)
print("Unix Timestamp:", unix_timestamp)
clip:SetClipProperty("Comments", unix_timestamp)
else
print("Could not parse date:", propDate)
end
end
# lua - use this code for the date modified column
pm = resolve:GetProjectManager()
proj = pm:GetCurrentProject()
mp = proj:GetMediaPool()
bin = mp:GetCurrentFolder()
print("in bin", bin:GetName())
clips = bin:GetClips()
for i, clip in pairs(clips) do
local propDate = clip:GetClipProperty("Date Modified")
print(propDate)
-- Example format: "Mon Apr 15 14:30:45 2026"
local dayName, monthStr, day, hour, min, sec, year =
string.match(propDate, "(%a+) (%a+) (%d+) (%d+):(%d+):(%d+) (%d+)")
local months = {
Jan = 1, Feb = 2, Mar = 3, Apr = 4,
May = 5, Jun = 6, Jul = 7, Aug = 8,
Sep = 9, Oct = 10, Nov = 11, Dec = 12
}
if dayName and monthStr then
local timestamp = os.time({
year = tonumber(year),
month = months[monthStr],
day = tonumber(day),
hour = tonumber(hour),
min = tonumber(min),
sec = tonumber(sec)
})
local unix_timestamp = tostring(timestamp)
print("Unix Timestamp:", unix_timestamp)
clip:SetClipProperty("Comments", unix_timestamp)
else
print("Could not parse date:", propDate)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment