CODE: [Copy to clipboard]
@echo off
::Convert any possitive real number N to YY-DD-HH-MM-SS-Ms
::N is not larger than 214748364799.
::Author: Scriptor@GUCAS
::Finished at: 13:07 09-16-2007
setlocal enabledelayedexpansion
set/p in=::
set /a y=0,d=0,h=0,m=0,s=0,ms=0 rem predefine the time. 2>nul
set/a ms=in%%100 rem cacl the ms_part 2>nul
if %in% gtr 100 set ms=%in:~-2%&set h=%in:~0,-2%
if %h% equ 0 goto :out rem only millisecond
call :clc !h!
:out
::: output the time
echo time %in% (ms) equals:
echo %y% Years %d% Days %h% Hours %m% Mins %s% Secs %ms% ms.
endlocal
pause&exit/b
:clc
if %1 gtr 0 (
set/a h=%1/3600
set/a m=%1%%3600/60
set/a s=%1%%3600%%60
)
if %h% geq 24 (
set/a y=%h%/24/365
set/a d=%h%/24%%365
set/a h%%=24
)
rem max is 214748364799 ms