View Single Post
Old 09-14-2022, 04:18 AM   #576
jpkar
Junior Member
jpkar began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2021
Location: Deutschland
Device: PocketBook
Quote:
Originally Posted by chaley View Post
Calibre doesn't support duration as a column type. Using integer is the best solution. The input should be formatted as the number of seconds. For example,
00:14:16 ==> 14 minutes + 16 seconds ==> 856 seconds
You can use a column built from other columns to display the number of seconds however you wish. For example, this template displays the number of seconds (I used a constant instead of the correct column lookup name) as hh:mm:ss
Code:
program:
	number_of_seconds = 856;
	hours = floor(number_of_seconds/3600);
	minutes = floor((number_of_seconds - (hours * 3600))/60);
	seconds = mod(number_of_seconds, 60);
	format_number(hours, '02d') & ':' & format_number(minutes, '02d') & ':' & format_number(seconds, '02d')
Note that you couldn't edit the value shown in the column built from other columns. You must edit the number_of_seconds column
Danke für deinen Vorschlag, habe Ihn wie folgt übernommen!
2 neue Spalten angelegt:
1. Spalte = aus anderen Spalten aufgebaute Spalte = #länge
2. Spalte = Ganzzahlen = #sekunden

Wie gelingt mir der Verweis auf die selbst definierte Spalte:"#sekunden"?

Vielen Dank
Attached Thumbnails
Click image for larger version

Name:	5.JPG
Views:	536
Size:	17.8 KB
ID:	196506   Click image for larger version

Name:	4.JPG
Views:	538
Size:	120.5 KB
ID:	196507  
jpkar is offline   Reply With Quote