1570af302Sopenharmony_ciint __month_to_secs(int month, int is_leap)
2570af302Sopenharmony_ci{
3570af302Sopenharmony_ci	static const int secs_through_month[] = {
4570af302Sopenharmony_ci		0, 31*86400, 59*86400, 90*86400,
5570af302Sopenharmony_ci		120*86400, 151*86400, 181*86400, 212*86400,
6570af302Sopenharmony_ci		243*86400, 273*86400, 304*86400, 334*86400 };
7570af302Sopenharmony_ci	int t = secs_through_month[month];
8570af302Sopenharmony_ci	if (is_leap && month >= 2) t+=86400;
9570af302Sopenharmony_ci	return t;
10570af302Sopenharmony_ci}
11