There is basically no algorithm to speak of
Pure algebra
Also to make up for
The deficiencies of that post
Pure algebra
Also to make up for
The deficiencies of that post
@echo off
::将任何正实数N转换为YY-DD-HH-MM-SS-Ms
::N不大于214748364799。
::作者:Scriptor@GUCAS
::完成于:2007年9月16日13:07
setlocal enabledelayedexpansion
set/p in=::
set /a y=0,d=0,h=0,m=0,s=0,ms=0 rem 预定义时间。2>nul
set/a ms=in%%100 rem 计算毫秒部分 2>nul
if %in% gtr 100 set ms=%in:~-2%&set h=%in:~0,-2%
if %h% equ 0 goto :out rem 只有毫秒
call :clc !h!
:out
::: 输出时间
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 最大值是214748364799毫秒
