Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* zTime - _Zume */
- stock GetMonthName(month)
- {
- static const MonhtsYears[12][24] = {
- "Enero",
- "Febrero",
- "Marzo",
- "Abril",
- "Mayo",
- "Junio",
- "Julio",
- "Agosto",
- "Septiembre",
- "Octubre",
- "Noviembre",
- "Diciembre"
- };
- new
- month_str[24]
- ;
- format(month_str, sizeof(month_str), "%s", MonhtsYears[month+1]);
- return month_str;
- }
- stock GetDayOfWeek(day, month, year)
- {
- static const DaysWeek[7][24] = {
- "Lunes",
- "Martes",
- "Miércoles",
- "Jueves",
- "Viernes",
- "Sábado",
- "Domingo"
- };
- new
- d_[4],
- m_[10]
- ;
- d_[0] = (14-month) / 12, d_[2] = year - d_[0], d_[1] = month + (12*d_[0]) - 2;
- d_[3] = (day + d_[2] + (d_[2]/4) - (d_[2]/100) + (d_[2]/400) + (31*d_[1]) / 12) % 7;
- if(d_[3] == 0) d_[3] = 7;
- format(m_, sizeof(m_), "%s", DaysWeek[d_[3]+1]);
- return m_;
- }
- stock GetTime()
- {
- new
- m_[34],
- d_[3]
- ;
- gettime(d_[0], d_[1], d_[2]), format(m_, sizeof(m_), "%02d:%02d:%02d", d_[0], d_[1], d_[2]);
- return m_;
- }
- stock GetDate()
- {
- new
- m_[34],
- d_[3]
- ;
- getdate(d_[0], d_[1], d_[2]);
- format(m_, sizeof(m_), "%s %d de %s del %d", GetDayOfWeek(d_[0], d_[1], d_[2]), d_[2], GetMonthName(d_[1]), d_[0]);
- return m_;
- }
- stock IsLeapDay(year)
- {
- return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement