Author Topic: CalculationOfTime  (Read 1461 times)

0 Members and 1 Guest are viewing this topic.

Offline CurryWurst

  • Camper
  • ***
  • Posts: 265
    • Soldat Global Account System
CalculationOfTime
« on: July 21, 2008, 07:48:56 pm »
Script Name: CalculationOfTime
Script Description: Didn't you ever wonder about converting seconds in a format like days hours:minutes:seconds? - Here's a pretty easy solution  8)
Original Author(s): Markus "Dual" Quär
Core Version: 2.6.3

Code: [Select]
function CalculationOfTime(NumberOfSeconds: integer): string;
begin
  Result:= IntToStr(NumberOfSeconds / 60 / 60 / 24) + 'd ' + IntToStr((NumberOfSeconds / 60 / 60) MOD 24) + ':' + IntToStr((NumberOfSeconds / 60) MOD 60) + ':' + IntToStr(NumberOfSeconds MOD 60) + 'h';
end;
Soldat Global Account System: #soldat.sgas @ quakenet

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: CalculationOfTime
« Reply #1 on: July 22, 2008, 03:18:16 pm »
Useful.
Thanks.
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community