#3018 Clock scan doesn't like some 12am values.

obsolete: 8.5a2
closed-fixed
Kevin B KENNY
5
2004-12-29
2004-12-23
Matt Morian
No

It seems "clock scan" doesn't properly recognize some
12am hour variants when using the format "clock scan
hhmm".

The examples listed below are from 8.5a2 on WinXP. I
also found the similar behavior with 8.4.7 on Solaris-
sparc.

Listed below are examples of some that work and do not
work properly:

% info patchlevel
8.5a2
%
% clock format [clock scan 0030] -format "%I:%M%p"
unable to convert date-time string "0030"
% clock format [clock scan 1030] -format "%I:%M%p"
10:30AM
% clock format [clock scan 0130] -format "%I:%M%p"
01:30AM
% clock format [clock scan 130] -format "%I:%M%p"
01:30AM
% clock format [clock scan 30] -format "%I:%M%p"
unable to convert date-time string "30"
% clock format [clock scan 00:30] -format "%I:%M%p"
12:30AM
% clock format [clock scan 00:00] -format "%I:%M%p"
12:00AM
% clock format [clock scan :00] -format "%I:%M%p"
unable to convert date-time string ":00"
% clock format [clock scan 000] -format "%I:%M%p"
12:00AM
% clock format [clock scan 0000] -format "%I:%M%p"
12:00AM
% clock scan 0000
1103695200
% clock scan 0030
unable to convert date-time string "0030"
% clock scan 0000
1103695200
% clock scan 000
1103695200
% clock scan 030
unable to convert date-time string "030"
% clock scan 00
1103695200
% clock scan 30
unable to convert date-time string "30"
% clock scan 0
1103695200
% clock scan 01
1103698800
% clock format [clock scan 01] -format "%I:%M%p"
01:00AM
% clock format [clock scan 0001] -format "%I:%M%p"
01:00AM
%

-Matt

Discussion

  • Kevin B KENNY
    Kevin B KENNY
    2004-12-29

    Logged In: YES
    user_id=99768

    [clock scan] was using the numeric value of the string, '0030',
    rather than its length, to decide what sort of thing it was.
    '30' isn't a valid time. '0030', of course, is.

    The problem is fixed in 8.5 but the fix
    will not be backported. (The current build system in
    8.4 does not successfully run 'make gendate', and
    the 8.5 'gendate' cannot be backported compatibly.)

     
  • Kevin B KENNY
    Kevin B KENNY
    2004-12-29

    • status: open --> closed-fixed