hlmod.hu
https://hlmod.hu/

V.I.P
https://hlmod.hu/viewtopic.php?f=9&t=25794
Oldal: 1 / 1

Szerző:  demon [2016.08.07. 17:34 ]
Hozzászólás témája:  Re: V.I.P

  1. asd( )
  2. {
  3.     static sTime[ 30 ], sYear[ 7 ], sMonth[ 5 ], sDay[ 5 ], sHour[ 5 ], sMin[ 5 ], iYear, iMonth, iDay, iHour, iMin;
  4.        
  5.     get_time( "%Y %m %d %H %M", sTime, charsmax( sTime ) );
  6.     parse( sTime, sYear, charsmax( sYear ), sMonth, charsmax( sMonth ), sDay, charsmax( sDay ), sHour, charsmax( sHour ), sMin, charsmax( sMin ) );
  7.    
  8.     iYear = str_to_num( sYear );
  9.     iMonth = str_to_num( sMonth );
  10.     iDay = str_to_num( sDay );
  11.     iHour = str_to_num( sHour ) + 2;
  12.     iMin = str_to_num( sMin );
  13.    
  14.     if ( iHour > 24 )
  15.     {
  16.         ++iDay;
  17.         iHour -= 24;
  18.         if ( iDay > GetDaysInMonth( iMonth, iYear ) )
  19.         {
  20.             iDay -= GetDaysInMonth( iMonth, iYear );
  21.             ++iMonth;
  22.             if ( iMonth > 12 )
  23.             {
  24.                 ++iYear;
  25.                 iMonth -= 12;
  26.             }
  27.         }
  28.     }
  29.     formatex( sTime, charsmax( sTime ), "%d.%02d.%02d. %02d-%02d", iYear, iMonth, iDay, iHour, iMin );
  30. }
  31. stock GetDaysInMonth( iMonth, iYear )
  32. {
  33.     switch( iMonth )
  34.     {
  35.         case 1, 3, 5, 7, 8, 10, 12: return 31;
  36.         case 2: return ( ( iYear % 4 ) == 0 ) ? 29 : 28;
  37.     }
  38.     return 30;
  39. }

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/