|I can kinda see what you're doing, but without the source-text (index.html, or at least the target-line "last updated"), I don't have enough information. I can say this: that batch sucks at dates/times, and vbscript handles them very smoothly:|
dateadd ("h","2:14 PM", 3) (17:14)
datediff ("s","2:14 PM","9:02 PM") (24480 seconds)
datediff("h","2:14 PM March 11","9:02 PM 3/12") (31 hours)
in short, many formats are accepted/handled properly, although you would have to strip off the "st", "rd", "th", "nd" from the date or otherwise handle it. The AM/PM stuff is handled with no problem. And system-date needs dofw stripped off:
Mon 03/11/13 to: 03/11/13
here's a "front-end" I wrote a couple years ago that executes the date math:
'this is the most "geared up" version. see dd, dx, daa for earlier versions
if a<1 then
if a<1 then
wscript.echo "add/subtract two times or dates, or add/sub units to a time or date"
wscript.echo "usage: da [units] time_and-or_date1 time_and-or_date2||number_of_units"
wscript.echo "Units is one of : D w m h N s and if caps, default format output"
wscript.echo "d=days, w=weeks, m=months (applied to date), h=hours, n=minutes, s=secs (applied to time)"
wscript.echo "Units default to days for dates, minutes for times"
'use colon to interpret as time, else date
'sets defaults for date (adjust no. days) or time (adjust no. minutes)
if p>0 then
'now allow overrides by token #1 if valid subset
if instr("dmwhns",lcase(y(0)))>0 then
'allow means for user to override formatting by using caps
if ucase(s)=s then ff=0
if isnumeric(y(a)) then