Why do these produce different results?

Why do these produce different results?

Post by Vincent Fati » Thu, 02 Apr 1998 04:00:00



Using CMD.EXE (NT4.0+SP3):

v:\> date /t
Tue 03-31-1998

Tue 3-31-98

FOR does not appear to be parsing what would otherwise be the output of
'date /t'. FOR's parsing of the output of 'time /t' is likewise not what you
might expect:

v:\> time /t
 7:35p

19:35:45

Is this unexpected behavior documented anywhere?

Thanks.

 - Vince
___
   Vincent Fatica
   Syracuse University Mathematics

   http://barnyard.syr.edu/~vefatica/

 
 
 

Why do these produce different results?

Post by Gary L. Smi » Thu, 02 Apr 1998 04:00:00


: Is this unexpected behavior documented anywhere?

I get somewhat different results:

[D:\] date /t
Wed 04/01/1998


Wed 04/01/1998

[D:\] time /t
 2:33


2:33

So I'd guess there must be some system setting involved.  I was surprised
to find leading zero suppression on the times -- that's one more thing
I'll have to look into.

--




 
 
 

Why do these produce different results?

Post by Tim Hill/MV » Thu, 02 Apr 1998 04:00:00


I used a slightly different syntax:

for /f "tokens=*" %i in ('date /t') do echo %i

However, I got identical results to the raw command, with the exception that
leading white-space was deleted (as expected). I suspect this is caused by
locale differences, although I did try a variety of different settings on my
machine, and could not get the two results to differ.

--
Tim Hill -- Windows NT MVP


>Using CMD.EXE (NT4.0+SP3):

>v:\> date /t
>Tue 03-31-1998

>Tue 3-31-98

>FOR does not appear to be parsing what would otherwise be the output of
>'date /t'. FOR's parsing of the output of 'time /t' is likewise not what
you
>might expect:

>v:\> time /t
> 7:35p

>19:35:45

>Is this unexpected behavior documented anywhere?

>Thanks.

> - Vince
>___
>   Vincent Fatica
>   Syracuse University Mathematics

>   http://barnyard.syr.edu/~vefatica/

 
 
 

Why do these produce different results?

Post by Vincent Fati » Fri, 03 Apr 1998 04:00:00



>I used a slightly different syntax:

>for /f "tokens=*" %i in ('date /t') do echo %i

>However, I got identical results to the raw command, with the exception that
>leading white-space was deleted (as expected). I suspect this is caused by
>locale differences, although I did try a variety of different settings on my
>machine, and could not get the two results to differ.

I have tried a variety of regional settings and the two approaches never match
(for 'date /t' or for 'time /t'). Even the suppression of the leading "0" in the
month is odd, since it's not exactly whitespace. Regardless of my regional
settings, 'date /t' always gives yyyy while the FOR approach always gives yy.
I'd really like to know what's going on. FOR is clearly not parsing what would
be stdout, yet, whatever FOR is parsing IS being partially formatted ... it gets
the correct separators. Have you tried it with 'time /t' ... with FOR, the
seconds magically show up.

FOR's command output parsing seems to be a rather generic thing ... giving you
exactly what's expected except in these two cases. I'd like to know what's going
on programatically. As little as I can figure it out, it would seem difficult to
duplicate this behavior on purpose.

Here are more, further simplified versions of the tests. At this moment, my
regional settings were MM-dd-yy and hh:mm:ss (so: why no "ss" in (a), why "yyyy"
in (c), why not "04" in (d)?)

a.      v:\> time /t
        19:44

        19:45:02
c.      v:\> date /t
        Wed 04-01-1998

        Wed  4-01-98

 - Vince
___
   Vincent Fatica
   Syracuse University Mathematics

   http://barnyard.syr.edu/~vefatica/

 
 
 

1. printing on Windows98 and Windows Nt produces different results

Hi,
I use the MM_ANISOTROPIC to prepare a CDC for printing. After querying the
device
about its physical size (CDC::GetDeviceCaps(PHYSICALWIDTH)) and resolution
(CDC::GetDeviceCaps(LOGPIXELSX)), I set the mapping mode to 10 logical units
per millimeter, on both axis. The result is exactly the expected one, on
Windows NT. However, on windows 98, (on same printer, but using the Win98
drivers, of course), the result is scaled to about 75-80% of the Windows NT
version! I feel very frustrated about this, because I checked and I feed the
SetViewportOrg, SetViewportExt, SetWindowOrg and SetWindowExt with SAME
values, on Windows NT and Windows 98, but the result are different!
Can anyone guide what to do about it?
TIA,
Remus

--
www.geocities.com/SiliconValley/Hills/9119

2. RHIDE window switching oddity

3. why are different binaries produced?

4. MenuBar in C++ Application

5. Different multicast api, different result ?

6. Question on Optima 28.8

7. Same program, different machine, different results?

8. BIG Problem while integrating Office 2000

9. GDI+ Region::Union produces wrong result

10. cell phone produces bad results

11. Q: int(0) and function overloading - which C++ compiler produces correct result?

12. Templated function with explicitly specified argument produces invalid results

13. Why different MTUs for different connection speeds?