90{
91 int m_Days
92 int m_Hours
93 int m_Minutes
94 int m_Seconds
95
97 {
98 m_Hours += m_Days * 24;
99
100 string h;
101 string m;
102 string s;
103
104 if (m_Hours < 10)
105 h = "0";
106
107 if (m_Minutes < 10)
108 m = "0";
109
110 if (m_Seconds < 10)
111 s = "0";
112
113 return string.
Format(
"%1%2:%3%4:%5%6", h, m_Hours, m, m_Minutes, s, m_Seconds);
114 }
115
117 {
118 return string.
Format(
"%1#STR_time_unit_abbrev_day_0 %2#STR_time_unit_abbrev_hour_0 %3#STR_time_unit_abbrev_minute_0 %4#STR_time_unit_abbrev_second_0", m_Days, m_Hours, m_Minutes, m_Seconds);
119 }
120
122 {
123 string message;
124
125 if (m_Days > 0)
126 message +=
string.
Format(
"%1#STR_time_unit_abbrev_day_0 ", m_Days);
127 if (m_Hours > 0)
128 message +=
string.
Format(
"%1#STR_time_unit_abbrev_hour_0 ", m_Hours);
129 if (m_Minutes > 0)
130 message +=
string.
Format(
"%1#STR_time_unit_abbrev_minute_0 ", m_Minutes);
131
132 message +=
string.
Format(
"%1#STR_time_unit_abbrev_second_0", m_Seconds);
133
134 return message;
135 }
136}
137
138class TimeConversions
139{
146 {
147 fullTime.m_Days = timeInSeconds / (24 * 3600);
148
149 timeInSeconds = timeInSeconds % (24 * 3600);
150 fullTime.m_Hours = timeInSeconds / 3600;
151
152 timeInSeconds = timeInSeconds % 3600;
153 fullTime.m_Minutes = timeInSeconds / 60;
154
155 timeInSeconds = timeInSeconds % 60;
156 fullTime.m_Seconds = timeInSeconds;
157 }
158}
class FullTimeData ConvertSecondsToFullTime(int timeInSeconds, out FullTimeData fullTime)
transform time in seconds into FullTimeData struct
string FormatedWithZero()
int m_Days int m_Hours int m_Minutes int m_Seconds string FormatedAsTimestamp()
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.