Essentially, you don't. In other words, batch is notorious for messing up "date math". I recommend either vbscript/jscript (native to windows) or powershell (3rd party) to handle this. Here's a stab at vbs approach: '==== begin vbs: foll line is target date x="1/1/2013 2:30 AM" 'or: x=wscript.arguments(0), where the argument is enclosed in dbl quotes. z=datediff("d",x,date)&" "&datediff("h",x,date) mod 24 wscript.echo z
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Purch hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.