How to interpret the timestamp in filename in downloaded files
HiI had to, one at a time :-(, to download 543 videos, not I need to be able to label to file names correctly.i.e. the downloaded file from Ring:1272036\_6870141820246961153\_stamp.mp4How do I translate the filename to a proper yyyyMMddhhmmss name?Thanks
7252 •
0 •
10 •
28-09-2020 07:50:49
Responses (8)
- S
For anyone still looking for this, I created a PowerShell Script to rename the files. function Convert-RingNameToDate { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=0, HelpMessage='Please add a help message here')] [System.Int64] $number ) $bits = [Convert]::ToString($number,2) $MSB = [string]$bits[0..30] -replace(' ','') $Dec = [convert]::ToInt64($MSB,2) $Epoch = Get-Date -Date "01/01/1970" $DateTime = $Epoch.AddSeconds($Dec) return (Get-date ($DateTime) -Format YYYY-mm-dd-HH-mm-ss) } $Folder = "D:\Temp\Ring" $Items = Get-ChildItem $Folder -Filter *.mp4 -Recurse Foreach ($item in $Items){ $newname = "$(Convert-RingNameToDate($item.BaseName)).mp4" if (-not (Test-Path "$($item.DirectoryName)\$($newname)") ){ $item | Rename-Item -NewName $newname } }To use:Where I download the videos in a ZIP file, and they are named:6946548309236321348.mp4Change $Folder to the location of your Ring Video files.You can modify the format of the filename from "yyyy-MM-dd-HH-mm-ss" to anything you like. [PowerShell date formatting](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-date?view=powershell-7.1#example-3--get-the-date-and-time-with-a--net-format-specifier)One more thing: I found the conversion to date/time was in UTC. If you wish to add or remove hours edit the line:$DateTime = $Epoch.AddSeconds($Dec)to $DateTime = $Epoch.AddSeconds($Dec).AddHours(-5) # CST
•2
11-04-2021 11:46:21
•
VThanks for writing the Powershell script! Only the format method was not correct. return (Get-date ($DateTime) -Format "yyyy/MM/dd HH:mm K")
•0
30-04-2021 08:59:05
WHi there. I just saw that the Ring Video file names are now in the form: Ring_542010902_2123_7079275696466310081.mp4 Can you updated your PowerShell script to cater for this new format? Much thanks! I could not get the script above to run, but will post the results on a separate post (to convert
•0
29-03-2022 02:26:00
- V
And for who is interrested, I've converted the Powershell script to a Python3 version: import datetime def ConvertDingIdToDateTime(dingId): bits = format(dingId, '0>42b') MSB = bits[0:31] dingDateTime = datetime.datetime.fromtimestamp(int(MSB,2)) return dingDateTime
•1
30-04-2021 09:00:21
•
AThanks to @vorigeweek for the Python bit! Here's *a* full script @Dan5ive. It's insanely ugly but I was in a hurry to get something to work. ``` from os import listdir from os.path import isfile, join import datetime import os def ConvertDingIdToDateTime(dingId): bits = format(dingId, '0>42b
•0
27-11-2021 03:26:29
- W
How do I request Ring do the conversion for us non-technical folk (I would think a MAJORITY of users are in this camp) so the videos are named something like:20210715-201523.mp4 where the video was taken on July 15, 2021 at 8:15:23PM ?AFAIK, Samsung smartphones and some cameras already name their files this way (or very similar).
•1
17-07-2021 20:50:05
•
- D
I've very recently discovered the filename issue. The day I need 80 videos that I can easily navigate the time each was taken, I find its just a string of numbers... I tried using the desktop app (I have an iMac) as I read this way of downloading files changes the filename to include a timestamp. But... you can only download one video at a time and if you have two videos taken within a minute it will only save one as the file name is the same. This is really annoying
•0
03-08-2021 14:49:08
•
Didn't find an answer ?
Log in or create your Ring account to post a question and join in the on the conversation.
Community Resources
Most Helpful Members
View All
©2024 Ring LLC or its affiliates
ecks
Hi Michael, the translation is simple, just convert the 6870141820246961153 number to hexa, use eight MSB bytes, convert to decimal, multiply by 1000 and convert th result from system time to date time. Your downloaded file was recorder on Tue Sep 08 2020 15:39:02Regards, Michael
4
30-01-2021 18:30:47
•