95{
96 int m_Days
97 int m_Hours
98 int m_Minutes
99 int m_Seconds
100
102 {
103 m_Hours += m_Days * 24;
104
105 string h;
106 string m;
107 string s;
108
109 if (m_Hours < 10)
110 h = "0";
111
112 if (m_Minutes < 10)
113 m = "0";
114
115 if (m_Seconds < 10)
116 s = "0";
117
118 return string.
Format(
"%1%2:%3%4:%5%6", h, m_Hours, m, m_Minutes, s, m_Seconds);
119 }
120
122 {
123 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);
124 }
125
127 {
128 string message;
129
130 if (m_Days > 0)
131 message +=
string.
Format(
"%1#STR_time_unit_abbrev_day_0 ", m_Days);
132 if (m_Hours > 0)
133 message +=
string.
Format(
"%1#STR_time_unit_abbrev_hour_0 ", m_Hours);
134 if (m_Minutes > 0)
135 message +=
string.
Format(
"%1#STR_time_unit_abbrev_minute_0 ", m_Minutes);
136
137 message +=
string.
Format(
"%1#STR_time_unit_abbrev_second_0", m_Seconds);
138
139 return message;
140 }
141}
142
143class TimeConversions
144{
151 {
152 fullTime.m_Days = timeInSeconds / (24 * 3600);
153
154 timeInSeconds = timeInSeconds % (24 * 3600);
155 fullTime.m_Hours = timeInSeconds / 3600;
156
157 timeInSeconds = timeInSeconds % 3600;
158 fullTime.m_Minutes = timeInSeconds / 60;
159
160 timeInSeconds = timeInSeconds % 60;
161 fullTime.m_Seconds = timeInSeconds;
162 }
163}
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.