2
* Copyright © 2002-2012 Bastien Nocera <hadess@hadess.net>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
* The Totem project hereby grant permission for non-gpl compatible GStreamer
19
* plugins to be used and distributed together with GStreamer and Totem. This
20
* permission is above and beyond the permissions granted by the GPL license
21
* Totem is covered by.
23
* Monday 7th February 2005: Christian Schaller: Add exception clause.
24
* See license_change file for details.
28
#include <glib/gi18n.h>
31
#include "totem-time-helpers.h"
35
* See https://bugzilla.gnome.org/show_bug.cgi?id=679850 */
37
totem_time_to_string (gint64 msecs)
39
int sec, min, hour, _time;
41
_time = (int) (msecs / 1000);
44
min = (_time % (60*60)) / 60;
45
_time = _time - (min * 60);
46
hour = _time / (60*60);
50
/* hour:minutes:seconds */
51
/* Translators: This is a time format, like "9:05:02" for 9
52
* hours, 5 minutes, and 2 seconds. You may change ":" to
53
* the separator that your locale uses or use "%Id" instead
54
* of "%d" if your locale uses localized digits.
56
return g_strdup_printf (C_("long time format", "%d:%02d:%02d"), hour, min, sec);
60
/* Translators: This is a time format, like "5:02" for 5
61
* minutes and 2 seconds. You may change ":" to the
62
* separator that your locale uses or use "%Id" instead of
63
* "%d" if your locale uses localized digits.
65
return g_strdup_printf (C_("short time format", "%d:%02d"), min, sec);