Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock ConvertUnixTime(unix_time, type = CONVERT_TIME_TO_SECONDS)
- {
- switch(type)
- {
- case CONVERT_TIME_TO_SECONDS:
- {
- unix_time %= 60;
- }
- case CONVERT_TIME_TO_MINUTES:
- {
- unix_time = (unix_time / 60) % 60;
- }
- case CONVERT_TIME_TO_HOURS:
- {
- unix_time = (unix_time / 3600) % 24;
- }
- case CONVERT_TIME_TO_DAYS:
- {
- unix_time = (unix_time / 86400) % 30;
- }
- case CONVERT_TIME_TO_MONTHS:
- {
- unix_time = (unix_time / 2629743) % 12;
- }
- case CONVERT_TIME_TO_YEARS:
- {
- unix_time = (unix_time / 31556926) + 1970;
- }
- default:
- unix_time %= 60;
- }
- return unix_time;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement