Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #15716 > unrolled thread

Check for military time

Started byDerek Turner <frderek@suremail.je>
First post2015-10-20 18:57 +0000
Last post2015-11-01 08:31 -0500
Articles 20 on this page of 128 — 22 participants

Back to article view | Back to comp.lang.php


Contents

  Check for military time Derek Turner <frderek@suremail.je> - 2015-10-20 18:57 +0000
    Re: Check for military time Derek Turner <frderek@suremail.je> - 2015-10-20 19:00 +0000
      Re: Check for military time Richard Yates <richard@yatesguitar.com> - 2015-10-20 21:35 -0700
        Re: Check for military time Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-10-21 16:12 -0400
          Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-21 22:38 -0400
            Re: Check for military time Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-10-22 10:43 -0400
              Re: Check for military time Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-10-22 10:48 -0400
              Re: Check for military time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-10-22 17:20 +0200
              Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-22 12:19 -0400
              Re: Check for military time "Peter H. Coffin" <hellsop@ninehells.com> - 2015-10-22 15:32 -0500
                Re: Check for military time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-10-22 23:08 +0200
                  Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-22 20:19 -0400
                    Re: Check for military time Matthew Carter <m@ahungry.com> - 2015-10-22 22:07 -0400
                  Re: Check for military time "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2015-10-23 02:26 +0000
                Re: Check for military time Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-10-22 17:13 -0400
                  Re: Check for military time Tim Streater <timstreater@greenbee.net> - 2015-10-22 22:57 +0100
                    Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-22 20:22 -0400
                      Re: Check for military time Tim Streater <timstreater@greenbee.net> - 2015-10-23 09:19 +0100
                        Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-23 09:32 -0400
                          Re: Check for military time Tim Streater <timstreater@greenbee.net> - 2015-10-23 15:43 +0100
                            Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-23 11:11 -0400
                          Re: Check for military time gordonb.nwjln@burditt.org (Gordon Burditt) - 2015-10-23 12:36 -0500
                            Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-23 13:40 -0400
                            Re: Check for military time Tim Streater <timstreater@greenbee.net> - 2015-10-23 18:54 +0100
                          Re: Check for military time Norman Peelman <npeelman@cfl.rr.com> - 2015-10-23 22:44 -0400
                            Re: Check for military time Tim Streater <timstreater@greenbee.net> - 2015-10-24 10:32 +0100
                            Re: Check for military time Derek Turner <frderek@suremail.je> - 2015-10-24 11:41 +0000
                              Re: Check for military time Norman Peelman <npeelman@cfl.rr.com> - 2015-10-24 15:15 -0400
                  Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-22 20:21 -0400
                    Re: Check for military time Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-10-22 20:38 -0400
                      Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-22 20:47 -0400
                Re: Check for military time gordonb.90ylr@burditt.org (Gordon Burditt) - 2015-10-22 18:21 -0500
                  Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-22 20:23 -0400
              Re: Check for military time gordonb.c5zx1@burditt.org (Gordon Burditt) - 2015-10-22 17:40 -0500
          Re: Check for military time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-10-22 11:12 +0200
            Re: Check for military time Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-10-22 11:06 -0400
              Re: Check for military time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-10-22 17:18 +0200
          Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-22 13:17 -0400
    Re: Check for military time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-10-21 13:55 +0200
      Re: Check for military time "M. Strobel" <strobel@example.com> - 2015-10-21 20:56 +0200
        Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-21 16:48 -0400
    Re: Check for military time Stephan Elinghaus <221015.6.seli@spamgourmet.com> - 2015-10-22 13:16 +0200
      Re: Check for military time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-10-22 15:11 +0200
        Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-22 10:23 -0400
          Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-10-27 14:10 +0100
            Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-27 09:25 -0400
              Re: Check for military time Jørn Andersen <jorn@jorna.dk> - 2015-10-27 15:19 +0100
                Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-27 10:41 -0400
                  Re: Check for military time Matthew Carter <m@ahungry.com> - 2015-10-27 23:03 -0400
                    Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-27 23:29 -0400
                      Re: Check for military time Erwin Moller <erwinmollerusenet@xs4all.nl> - 2015-10-29 10:08 +0100
                        Re: Check for military time Matthew Carter <m@ahungry.com> - 2015-10-29 21:44 -0400
                          Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-29 22:35 -0400
                            Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-10-30 20:08 +0100
                              Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-30 16:22 -0400
                                Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-01 11:58 +0100
                                  Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-01 08:27 -0500
                                    Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-01 14:36 +0100
                                      Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-01 09:05 -0500
                                        Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-01 16:51 +0100
                                          Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-01 11:09 -0500
                          Re: Check for military time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-10-30 22:33 +0100
                            Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-30 20:01 -0400
                            Re: Check for military time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-11-03 19:51 +0100
                          Re: Check for military time Erwin Moller <erwinmollerusenet@xs4all.nl> - 2015-11-02 13:51 +0100
                            Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-02 18:57 +0100
                              Re: Check for military time Erwin Moller <erwinmollerusenet@xs4all.nl> - 2015-11-04 15:18 +0100
                                Re: Check for military time Matthew Carter <m@ahungry.com> - 2015-11-04 21:18 -0500
                                Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-05 07:51 +0100
                  Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-10-30 20:04 +0100
                    Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-30 16:24 -0400
                      Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-01 12:06 +0100
                        Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-01 08:30 -0500
                          Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-01 14:39 +0100
                            Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-01 09:07 -0500
                              Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-01 16:58 +0100
                                Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-01 11:05 -0500
                                  Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-02 08:14 +0100
                                    Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-02 10:01 -0500
                                      Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-02 17:54 +0100
                                        Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-02 12:50 -0500
                                          Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-02 19:05 +0100
                                            Re: Check for military time Tim Streater <timstreater@greenbee.net> - 2015-11-02 18:23 +0000
                                              Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-02 15:23 -0500
                                            Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-02 15:16 -0500
                                              Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-03 05:47 +0100
                                                Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-03 08:47 -0500
                                                  Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-04 03:55 +0100
                                                    Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-03 22:09 -0500
                                                      Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-04 08:49 +0100
                                                        Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-04 08:29 -0500
                                                          Re: Check for military time Paul Herber <paul@pherber.com> - 2015-11-04 14:14 +0000
                                                            Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-04 10:00 -0500
                                                        Re: Check for military time Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-11-06 13:11 +0100
                                                          Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-06 09:45 -0500
                                                            Re: Check for military time Matthew Carter <m@ahungry.com> - 2015-11-07 21:50 -0500
                                                              Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-07 22:05 -0500
                                                Re: Check for military time gordonb.2zzss@burditt.org (Gordon Burditt) - 2015-11-08 20:50 -0600
                                                  Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-09 10:29 +0100
                                                    Re: Check for military time gordonb.00syf@burditt.org (Gordon Burditt) - 2015-11-10 23:42 -0600
                                                      Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-11 07:46 +0100
                                                        Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-11 07:50 +0100
                                                          Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-11 08:06 -0500
                                                            Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-11 15:15 +0100
                                                              Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-11 09:21 -0500
                                                                Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-11 17:46 +0100
                                                                  Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-11 15:12 -0500
                                                                    Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-11 22:23 +0100
                                                                      Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-11 17:17 -0500
                                                        Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-11 08:05 -0500
                                                          OT: Munging addresses (was: Re: Check for military time) Arno Welzel <usenet@arnowelzel.de> - 2015-11-11 19:18 +0100
                                                            Re: OT: Munging addresses Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-11 15:16 -0500
                                                              Re: OT: Munging addresses Arno Welzel <usenet@arnowelzel.de> - 2015-11-11 22:29 +0100
                                                                Re: OT: Munging addresses Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-11 17:20 -0500
                                                                  Re: OT: Munging addresses Arno Welzel <usenet@arnowelzel.de> - 2015-11-12 07:47 +0100
                                                                    Re: OT: Munging addresses Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-12 10:15 -0500
                                                                      Re: OT: Munging addresses Arno Welzel <usenet@arnowelzel.de> - 2015-11-12 17:17 +0100
                                                                        Re: OT: Munging addresses Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-12 11:59 -0500
                                                                          Re: OT: Munging addresses Arno Welzel <usenet@arnowelzel.de> - 2015-11-12 18:51 +0100
                                                                            Re: OT: Munging addresses Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-12 14:20 -0500
                                                                              Re: OT: Munging addresses Arno Welzel <usenet@arnowelzel.de> - 2015-11-12 20:59 +0100
                                                                                Re: OT: Munging addresses Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-12 16:54 -0500
                                                                Re: OT: Munging addresses Jim Higgins <ILikeMy@Privacy.invalid> - 2015-11-18 16:24 +0000
                PHP code section end marker (was: Check for military time) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-10-27 22:58 +0100
              Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-10-30 20:01 +0100
                Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-10-30 16:27 -0400
                  Re: Check for military time Arno Welzel <usenet@arnowelzel.de> - 2015-11-01 12:12 +0100
                    Re: Check for military time Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-01 08:31 -0500

Page 1 of 7  [1] 2 3 4 5 6 7  Next page →


#15716 — Check for military time

FromDerek Turner <frderek@suremail.je>
Date2015-10-20 18:57 +0000
SubjectCheck for military time
Message-ID<d8nh4uFgdr2U1@mid.individual.net>
Is there a quick and dirty way to check that

substr($string, 0 ,3) is a valid military time, ie. 0000-2359?

tia

Derek

[toc] | [next] | [standalone]


#15717

FromDerek Turner <frderek@suremail.je>
Date2015-10-20 19:00 +0000
Message-ID<d8nha3Fgdr2U2@mid.individual.net>
In reply to#15716
On Tue, 20 Oct 2015 18:57:34 +0000, Derek Turner wrote:

> Is there a quick and dirty way to check that
> 
> substr($string, 0 ,3) is a valid military time, ie. 0000-2359?
> 
> tia
> 
> Derek

sorry, that should, of course, read ($string, 0, 4)

[toc] | [prev] | [next] | [standalone]


#15720

FromRichard Yates <richard@yatesguitar.com>
Date2015-10-20 21:35 -0700
Message-ID<kf5e2blfd3545p492dnnii47an4jkmu62e@4ax.com>
In reply to#15717
On 20 Oct 2015 19:00:19 GMT, Derek Turner <frderek@suremail.je> wrote:

>On Tue, 20 Oct 2015 18:57:34 +0000, Derek Turner wrote:
>
>> Is there a quick and dirty way to check that
>> 
>> substr($string, 0 ,3) is a valid military time, ie. 0000-2359?
>> 
>> tia
>> 
>> Derek
>
>sorry, that should, of course, read ($string, 0, 4)

This seems to work, but I did not test all cases:

echo (strtotime($time)) ? 'Pass' : 'Fail';

[toc] | [prev] | [next] | [standalone]


#15725

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2015-10-21 16:12 -0400
Message-ID<%kSVx.210845$HZ6.47102@fx12.iad>
In reply to#15720
On Wednesday October 21 2015 00:35, in comp.lang.php, "Richard Yates"
<richard@yatesguitar.com> wrote:

> On 20 Oct 2015 19:00:19 GMT, Derek Turner <frderek@suremail.je> wrote:
> 
>>On Tue, 20 Oct 2015 18:57:34 +0000, Derek Turner wrote:
>>
>>> Is there a quick and dirty way to check that
>>> 
>>> substr($string, 0 ,3) is a valid military time, ie. 0000-2359?
>>> 
>>> tia
>>> 
>>> Derek
>>
>>sorry, that should, of course, read ($string, 0, 4)
> 
> This seems to work, but I did not test all cases:
> 
> echo (strtotime($time)) ? 'Pass' : 'Fail';

PHP Version 5.4.45

I tried all integer test cases between 0000 and 2599, and found that this test
seems to fail on the range "1960" to "1999". On the off chance that the
strtotime() call interpreted its argument as a date, I modified the argument
to explicitly indicate military time (by prefixing it with a 't'). Still, the
same 40 errors occurred, where "t1960" through "t1999" resulted in
strtotime() returning an integer instead of FALSE.

Here's the test code
<html>
<head><title>Test time</title></head>
<body>
<ul>
<?php
  $success = 0;
  $failed = 0;

  for ($ts = 0; $ts < 2600; ++$ts)
  {
    $time = sprintf("t%04.4u",$ts);
    $expect = ((floor($ts/100) <= 24) && ($ts % 100 < 60)) ? 'Pass' : 'Fail';
    $result =  (strtotime($time)) ? 'Pass' : 'Fail';
    $matched = ($expect == $result) ? 'Success' : 'Failed';
    printf("<li>%s - %s: expected %s, got %s</li>\n",
           $time,$matched,$expect,$result);
    if ($matched == 'Success')
      ++$success;
    else
      ++$failed;
  }
?>
</ul>
<?php
  printf("%u Successful cases, %u failures\n",$success,$failed);
?>
</body>
</html>


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

[toc] | [prev] | [next] | [standalone]


#15727

FromJerry Stuckle <jstucklex@attglobal.net>
Date2015-10-21 22:38 -0400
Message-ID<n09i2i$f8i$1@dont-email.me>
In reply to#15725
On 10/21/2015 4:12 PM, Lew Pitcher wrote:
> On Wednesday October 21 2015 00:35, in comp.lang.php, "Richard Yates"
> <richard@yatesguitar.com> wrote:
> 
>> On 20 Oct 2015 19:00:19 GMT, Derek Turner <frderek@suremail.je> wrote:
>>
>>> On Tue, 20 Oct 2015 18:57:34 +0000, Derek Turner wrote:
>>>
>>>> Is there a quick and dirty way to check that
>>>>
>>>> substr($string, 0 ,3) is a valid military time, ie. 0000-2359?
>>>>
>>>> tia
>>>>
>>>> Derek
>>>
>>> sorry, that should, of course, read ($string, 0, 4)
>>
>> This seems to work, but I did not test all cases:
>>
>> echo (strtotime($time)) ? 'Pass' : 'Fail';
> 
> PHP Version 5.4.45
> 
> I tried all integer test cases between 0000 and 2599, and found that this test
> seems to fail on the range "1960" to "1999". On the off chance that the
> strtotime() call interpreted its argument as a date, I modified the argument
> to explicitly indicate military time (by prefixing it with a 't'). Still, the
> same 40 errors occurred, where "t1960" through "t1999" resulted in
> strtotime() returning an integer instead of FALSE.
> 
> Here's the test code
> <html>
> <head><title>Test time</title></head>
> <body>
> <ul>
> <?php
>   $success = 0;
>   $failed = 0;
> 
>   for ($ts = 0; $ts < 2600; ++$ts)
>   {
>     $time = sprintf("t%04.4u",$ts);
>     $expect = ((floor($ts/100) <= 24) && ($ts % 100 < 60)) ? 'Pass' : 'Fail';
>     $result =  (strtotime($time)) ? 'Pass' : 'Fail';
>     $matched = ($expect == $result) ? 'Success' : 'Failed';
>     printf("<li>%s - %s: expected %s, got %s</li>\n",
>            $time,$matched,$expect,$result);
>     if ($matched == 'Success')
>       ++$success;
>     else
>       ++$failed;
>   }
> ?>
> </ul>
> <?php
>   printf("%u Successful cases, %u failures\n",$success,$failed);
> ?>
> </body>
> </html>
> 
> 

Your logic is fallacious.  The following code works and displays invalid
times:

<?php
  $success = 0;
  $failed = 0;

  for ($ts = 0; $ts < 2600; ++$ts)
  {
    $time = sprintf("%04.4u",$ts);
    $result =  (strtotime($time));
    if ($result)
      ++$success;
    else {
      ++$failed;
      printf("%s failed\n", $time);

	}
  }
  printf("%u Successful cases, %u failures\n",$success,$failed);
?>


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#15732

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2015-10-22 10:43 -0400
Message-ID<PC6Wx.93819$9Q4.38733@fx01.iad>
In reply to#15727
On Wednesday October 21 2015 22:38, in comp.lang.php, "Jerry Stuckle"
<jstucklex@attglobal.net> wrote:

> On 10/21/2015 4:12 PM, Lew Pitcher wrote:
>> On Wednesday October 21 2015 00:35, in comp.lang.php, "Richard Yates"
>> <richard@yatesguitar.com> wrote:
>> 
>>> On 20 Oct 2015 19:00:19 GMT, Derek Turner <frderek@suremail.je> wrote:
>>>
>>>> On Tue, 20 Oct 2015 18:57:34 +0000, Derek Turner wrote:
>>>>
>>>>> Is there a quick and dirty way to check that
>>>>>
>>>>> substr($string, 0 ,3) is a valid military time, ie. 0000-2359?
>>>>>
>>>>> tia
>>>>>
>>>>> Derek
>>>>
>>>> sorry, that should, of course, read ($string, 0, 4)
>>>
>>> This seems to work, but I did not test all cases:
>>>
>>> echo (strtotime($time)) ? 'Pass' : 'Fail';
>> 
>> PHP Version 5.4.45
>> 
>> I tried all integer test cases between 0000 and 2599, and found that this
>> test seems to fail on the range "1960" to "1999". On the off chance that
>> the strtotime() call interpreted its argument as a date, I modified the
>> argument to explicitly indicate military time (by prefixing it with a 't').
>> Still, the same 40 errors occurred, where "t1960" through "t1999" resulted
>> in strtotime() returning an integer instead of FALSE.
>> 
>> Here's the test code
>> <html>
>> <head><title>Test time</title></head>
>> <body>
>> <ul>
>> <?php
>>   $success = 0;
>>   $failed = 0;
>> 
>>   for ($ts = 0; $ts < 2600; ++$ts)
>>   {
>>     $time = sprintf("t%04.4u",$ts);
>>     $expect = ((floor($ts/100) <= 24) && ($ts % 100 < 60)) ? 'Pass' :
>>     'Fail';
>>     $result =  (strtotime($time)) ? 'Pass' : 'Fail';
>>     $matched = ($expect == $result) ? 'Success' : 'Failed';
>>     printf("<li>%s - %s: expected %s, got %s</li>\n",
>>            $time,$matched,$expect,$result);
>>     if ($matched == 'Success')
>>       ++$success;
>>     else
>>       ++$failed;
>>   }
>> ?>
>> </ul>
>> <?php
>>   printf("%u Successful cases, %u failures\n",$success,$failed);
>> ?>
>> </body>
>> </html>
>> 
>> 
> 
> Your logic is fallacious.

I disagree. You will have to prove your statement.

> The following code works and displays invalid 
> times:
> 
> <?php
>   $success = 0;
>   $failed = 0;
> 
>   for ($ts = 0; $ts < 2600; ++$ts)
>   {
>     $time = sprintf("%04.4u",$ts);
>     $result =  (strtotime($time));
>     if ($result)
>       ++$success;
>     else {
>       ++$failed;
>       printf("%s failed\n", $time);
> 
> }
>   }
>   printf("%u Successful cases, %u failures\n",$success,$failed);
> ?>

Results in 
  1540 Successful cases, 1060 failures

But, in the military clock, there are 25 hours (00 through 24) and 60 minutes
per hour (00 through 59). Thus, in 2600 test cases, ranging sequentially from
0000 through 2599, there should be 25x60 successes 25 hours, with 60 values
inside of the 00-59 range). That means 1500 successes in 2600 test cases.

But, your logic came up with 1540 successes. Apparently, your code got
40 "wrong" timestamps wrong.  Now, Jerry, *which* 40 were wrong?

FWIW, my code reported that, in the same 2600 test cases, 2560 test cases
resulted in the expected results (strtotime() reporting a valid value for
valid time, or reporting false for an invalid time), and 40 anomalous results
(strtotime() gave a valid value for an invalid time, or returned false for a
valid time).

Perhaps you didn't read or understand the purpose of my code?

-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

[toc] | [prev] | [next] | [standalone]


#15733

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2015-10-22 10:48 -0400
Message-ID<EG6Wx.59598$gO.28272@fx19.iad>
In reply to#15732
On Thursday October 22 2015 10:43, in comp.lang.php, "Lew Pitcher"
<lew.pitcher@digitalfreehold.ca> wrote:

> On Wednesday October 21 2015 22:38, in comp.lang.php, "Jerry Stuckle"
> <jstucklex@attglobal.net> wrote:
> 
>> On 10/21/2015 4:12 PM, Lew Pitcher wrote:
>>> On Wednesday October 21 2015 00:35, in comp.lang.php, "Richard Yates"
>>> <richard@yatesguitar.com> wrote:
>>> 
>>>> On 20 Oct 2015 19:00:19 GMT, Derek Turner <frderek@suremail.je> wrote:
>>>>
>>>>> On Tue, 20 Oct 2015 18:57:34 +0000, Derek Turner wrote:
>>>>>
>>>>>> Is there a quick and dirty way to check that
>>>>>>
>>>>>> substr($string, 0 ,3) is a valid military time, ie. 0000-2359?
>>>>>>
>>>>>> tia
>>>>>>
>>>>>> Derek
>>>>>
>>>>> sorry, that should, of course, read ($string, 0, 4)
>>>>
>>>> This seems to work, but I did not test all cases:
>>>>
>>>> echo (strtotime($time)) ? 'Pass' : 'Fail';
>>> 
>>> PHP Version 5.4.45
>>> 
>>> I tried all integer test cases between 0000 and 2599, and found that this
>>> test seems to fail on the range "1960" to "1999". On the off chance that
>>> the strtotime() call interpreted its argument as a date, I modified the
>>> argument to explicitly indicate military time (by prefixing it with a
>>> 't'). Still, the same 40 errors occurred, where "t1960" through "t1999"
>>> resulted in strtotime() returning an integer instead of FALSE.
>>> 
>>> Here's the test code
>>> <html>
>>> <head><title>Test time</title></head>
>>> <body>
>>> <ul>
>>> <?php
>>>   $success = 0;
>>>   $failed = 0;
>>> 
>>>   for ($ts = 0; $ts < 2600; ++$ts)
>>>   {
>>>     $time = sprintf("t%04.4u",$ts);
>>>     $expect = ((floor($ts/100) <= 24) && ($ts % 100 < 60)) ? 'Pass' :
>>>     'Fail';
>>>     $result =  (strtotime($time)) ? 'Pass' : 'Fail';
>>>     $matched = ($expect == $result) ? 'Success' : 'Failed';
>>>     printf("<li>%s - %s: expected %s, got %s</li>\n",
>>>            $time,$matched,$expect,$result);
>>>     if ($matched == 'Success')
>>>       ++$success;
>>>     else
>>>       ++$failed;
>>>   }
>>> ?>
>>> </ul>
>>> <?php
>>>   printf("%u Successful cases, %u failures\n",$success,$failed);
>>> ?>
>>> </body>
>>> </html>
>>> 
>>> 
>> 
>> Your logic is fallacious.
> 
> I disagree. You will have to prove your statement.
> 
>> The following code works and displays invalid
>> times:
>> 
>> <?php
>>   $success = 0;
>>   $failed = 0;
>> 
>>   for ($ts = 0; $ts < 2600; ++$ts)
>>   {
>>     $time = sprintf("%04.4u",$ts);
>>     $result =  (strtotime($time));
>>     if ($result)
>>       ++$success;
>>     else {
>>       ++$failed;
>>       printf("%s failed\n", $time);
>> 
>> }
>>   }
>>   printf("%u Successful cases, %u failures\n",$success,$failed);
>> ?>
> 
> Results in
>   1540 Successful cases, 1060 failures
> 
> But, in the military clock, there are 25 hours (00 through 24) and 60
> minutes per hour (00 through 59). Thus, in 2600 test cases, ranging
> sequentially from 0000 through 2599, there should be 25x60 successes 25
> hours, with 60 values inside of the 00-59 range). That means 1500 successes
> in 2600 test cases.
> 
> But, your logic came up with 1540 successes. Apparently, your code got
> 40 "wrong" timestamps wrong.  Now, Jerry, *which* 40 were wrong?

I cleaned up your code's output and noticed
 1896 failed
 1897 failed
 1898 failed
 1899 failed
 2060 failed
 2061 failed
 2062 failed
 2063 failed
 2064 failed
 2065 failed

Hmmmm..... what happened to 1960 through 1999? Your code seems to think that
these are valid timestamps, as it *DID NOT* mark them as failures (and
counted them in the "$success" count.

> FWIW, my code reported that, in the same 2600 test cases, 2560 test cases
> resulted in the expected results (strtotime() reporting a valid value for
> valid time, or reporting false for an invalid time), and 40 anomalous
> results (strtotime() gave a valid value for an invalid time, or returned
> false for a valid time).
> 
> Perhaps you didn't read or understand the purpose of my code?
> 


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

[toc] | [prev] | [next] | [standalone]


#15736

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2015-10-22 17:20 +0200
Message-ID<3358708.tDfftRraDu@PointedEars.de>
In reply to#15732
Lew Pitcher wrote:

> But, in the military clock, there are 25 hours (00 through 24) and 60
> minutes per hour (00 through 59). […]

Then the test code I posted has to be modified slightly.

-- 
PointedEars
Zend Certified PHP Engineer
Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#15737

FromJerry Stuckle <jstucklex@attglobal.net>
Date2015-10-22 12:19 -0400
Message-ID<n0b269$69m$1@dont-email.me>
In reply to#15732
On 10/22/2015 10:43 AM, Lew Pitcher wrote:
> On Wednesday October 21 2015 22:38, in comp.lang.php, "Jerry Stuckle"
> <jstucklex@attglobal.net> wrote:
> 
>> On 10/21/2015 4:12 PM, Lew Pitcher wrote:
>>> On Wednesday October 21 2015 00:35, in comp.lang.php, "Richard Yates"
>>> <richard@yatesguitar.com> wrote:
>>>
>>>> On 20 Oct 2015 19:00:19 GMT, Derek Turner <frderek@suremail.je> wrote:
>>>>
>>>>> On Tue, 20 Oct 2015 18:57:34 +0000, Derek Turner wrote:
>>>>>
>>>>>> Is there a quick and dirty way to check that
>>>>>>
>>>>>> substr($string, 0 ,3) is a valid military time, ie. 0000-2359?
>>>>>>
>>>>>> tia
>>>>>>
>>>>>> Derek
>>>>>
>>>>> sorry, that should, of course, read ($string, 0, 4)
>>>>
>>>> This seems to work, but I did not test all cases:
>>>>
>>>> echo (strtotime($time)) ? 'Pass' : 'Fail';
>>>
>>> PHP Version 5.4.45
>>>
>>> I tried all integer test cases between 0000 and 2599, and found that this
>>> test seems to fail on the range "1960" to "1999". On the off chance that
>>> the strtotime() call interpreted its argument as a date, I modified the
>>> argument to explicitly indicate military time (by prefixing it with a 't').
>>> Still, the same 40 errors occurred, where "t1960" through "t1999" resulted
>>> in strtotime() returning an integer instead of FALSE.
>>>
>>> Here's the test code
>>> <html>
>>> <head><title>Test time</title></head>
>>> <body>
>>> <ul>
>>> <?php
>>>   $success = 0;
>>>   $failed = 0;
>>>
>>>   for ($ts = 0; $ts < 2600; ++$ts)
>>>   {
>>>     $time = sprintf("t%04.4u",$ts);
>>>     $expect = ((floor($ts/100) <= 24) && ($ts % 100 < 60)) ? 'Pass' :
>>>     'Fail';
>>>     $result =  (strtotime($time)) ? 'Pass' : 'Fail';
>>>     $matched = ($expect == $result) ? 'Success' : 'Failed';
>>>     printf("<li>%s - %s: expected %s, got %s</li>\n",
>>>            $time,$matched,$expect,$result);
>>>     if ($matched == 'Success')
>>>       ++$success;
>>>     else
>>>       ++$failed;
>>>   }
>>> ?>
>>> </ul>
>>> <?php
>>>   printf("%u Successful cases, %u failures\n",$success,$failed);
>>> ?>
>>> </body>
>>> </html>
>>>
>>>
>>
>> Your logic is fallacious.
> 
> I disagree. You will have to prove your statement.
> 
>> The following code works and displays invalid 
>> times:
>>
>> <?php
>>   $success = 0;
>>   $failed = 0;
>>
>>   for ($ts = 0; $ts < 2600; ++$ts)
>>   {
>>     $time = sprintf("%04.4u",$ts);
>>     $result =  (strtotime($time));
>>     if ($result)
>>       ++$success;
>>     else {
>>       ++$failed;
>>       printf("%s failed\n", $time);
>>
>> }
>>   }
>>   printf("%u Successful cases, %u failures\n",$success,$failed);
>> ?>
> 
> Results in 
>   1540 Successful cases, 1060 failures
> 
> But, in the military clock, there are 25 hours (00 through 24) and 60 minutes
> per hour (00 through 59). Thus, in 2600 test cases, ranging sequentially from
> 0000 through 2599, there should be 25x60 successes 25 hours, with 60 values
> inside of the 00-59 range). That means 1500 successes in 2600 test cases.
> 
> But, your logic came up with 1540 successes. Apparently, your code got
> 40 "wrong" timestamps wrong.  Now, Jerry, *which* 40 were wrong?
> 
> FWIW, my code reported that, in the same 2600 test cases, 2560 test cases
> resulted in the expected results (strtotime() reporting a valid value for
> valid time, or reporting false for an invalid time), and 40 anomalous results
> (strtotime() gave a valid value for an invalid time, or returned false for a
> valid time).
> 
> Perhaps you didn't read or understand the purpose of my code?
> 

I read and understood the purpose of your code.  Then I wrote my own
code and ran it under PHP 5.6.13 (64 bit).  It came out with 1500
successes and 1100 failures, as expected.

The problem was I don't have access to Usenet from that machine, so I
ran the code on a Windows machine which is currently running PHP 5.4.14
(again, 64 bit) where if failed.  The problem is I didn't as much
attention to the output that I should have.

So it looks like a bug which has been fixed in PHP 5.6.13 (at least on
Linux).


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#15739

From"Peter H. Coffin" <hellsop@ninehells.com>
Date2015-10-22 15:32 -0500
Message-ID<slrnn2ihu3.us5.hellsop@nibelheim.ninehells.com>
In reply to#15732
On Thu, 22 Oct 2015 10:43:58 -0400, Lew Pitcher wrote:
>
> But, in the military clock, there are 25 hours (00 through 24) and 60 minutes
> per hour (00 through 59). Thus, in 2600 test cases, ranging sequentially from
> 0000 through 2599, there should be 25x60 successes 25 hours, with 60 values
> inside of the 00-59 range). That means 1500 successes in 2600 test cases.

I am pretty sure that this is not the case. I have never seen "24:xx". I
have, however, seen "03:60". Leapseconds are rare, but happen often
enough that code looking for valid times should account for it.

-- 
16 megs in a '95 box! Yo Ho Ho and a battle of RAM!

[toc] | [prev] | [next] | [standalone]


#15740

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2015-10-22 23:08 +0200
Message-ID<62854723.f7DkCZnGup@PointedEars.de>
In reply to#15739
Peter H. Coffin wrote:

> On Thu, 22 Oct 2015 10:43:58 -0400, Lew Pitcher wrote:
>> But, in the military clock, there are 25 hours (00 through 24) and 60
>> minutes per hour (00 through 59). Thus, in 2600 test cases, ranging
>> sequentially from 0000 through 2599, there should be 25x60 successes 25
>> hours, with 60 values inside of the 00-59 range). That means 1500
>> successes in 2600 test cases.
> 
> I am pretty sure that this is not the case. I have never seen "24:xx".

I have never been in the military, and hopefully never will be, but I find 
it reasonable that they would adopt the timekeeping standard of having days 
from 00:00:00.000 to 24:00:00.000 inclusive.

> I have, however, seen "03:60". Leapseconds are rare, but happen often
> enough that code looking for valid times should account for it.

ACK.

-- 
PointedEars
Zend Certified PHP Engineer
Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#15745

FromJerry Stuckle <jstucklex@attglobal.net>
Date2015-10-22 20:19 -0400
Message-ID<n0buaa$kmh$1@dont-email.me>
In reply to#15740
On 10/22/2015 5:08 PM, Thomas 'Pointed Head' Lahn wrote:
> Peter H. Coffin wrote:
> 
>> On Thu, 22 Oct 2015 10:43:58 -0400, Lew Pitcher wrote:
>>> But, in the military clock, there are 25 hours (00 through 24) and 60
>>> minutes per hour (00 through 59). Thus, in 2600 test cases, ranging
>>> sequentially from 0000 through 2599, there should be 25x60 successes 25
>>> hours, with 60 values inside of the 00-59 range). That means 1500
>>> successes in 2600 test cases.
>>
>> I am pretty sure that this is not the case. I have never seen "24:xx".
> 
> I have never been in the military, and hopefully never will be, but I find 
> it reasonable that they would adopt the timekeeping standard of having days 
> from 00:00:00.000 to 24:00:00.000 inclusive.
>

How fortunate for the military.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#15751

FromMatthew Carter <m@ahungry.com>
Date2015-10-22 22:07 -0400
Message-ID<87y4euibhb.fsf@ahungry.com>
In reply to#15745
Jerry Stuckle <jstucklex@attglobal.net> writes:

> On 10/22/2015 5:08 PM, Thomas 'Pointed Head' Lahn wrote:
>> Peter H. Coffin wrote:
>> 
>>> On Thu, 22 Oct 2015 10:43:58 -0400, Lew Pitcher wrote:
>>>> But, in the military clock, there are 25 hours (00 through 24) and 60
>>>> minutes per hour (00 through 59). Thus, in 2600 test cases, ranging
>>>> sequentially from 0000 through 2599, there should be 25x60 successes 25
>>>> hours, with 60 values inside of the 00-59 range). That means 1500
>>>> successes in 2600 test cases.
>>>
>>> I am pretty sure that this is not the case. I have never seen "24:xx".
>> 
>> I have never been in the military, and hopefully never will be, but I find 
>> it reasonable that they would adopt the timekeeping standard of having days 
>> from 00:00:00.000 to 24:00:00.000 inclusive.
>>
>
> How fortunate for the military.
It's considered a science vessel, despite a full array of armaments.

-- 
Matthew Carter (m@ahungry.com)
http://ahungry.com

[toc] | [prev] | [next] | [standalone]


#15752

From"Beauregard T. Shagnasty" <a.nony.mous@example.invalid>
Date2015-10-23 02:26 +0000
Message-ID<n0c5t8$1au$1@dont-email.me>
In reply to#15740
Thomas 'PointedHead' Lahn wrote:

> I have never been in the military,

..and so don't know about their time.

> and hopefully never will be,

Good. We don't need you.

> but I
> find it reasonable that they would adopt the timekeeping standard of
> having days from 00:00:00.000 to 24:00:00.000 inclusive.

00:00:00.000 to 24:00:00.000 are functionally the same, but "24" is never 
used. The day ends at 23:59:59.999 and then ticks over back to 
00:00:00.000.

-- 
   -bts
   -This space for rent, but the price is high

[toc] | [prev] | [next] | [standalone]


#15741

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2015-10-22 17:13 -0400
Message-ID<RjcWx.106396$DK7.88540@fx02.iad>
In reply to#15739
On Thursday October 22 2015 16:32, in comp.lang.php, "Peter H. Coffin"
<hellsop@ninehells.com> wrote:

> On Thu, 22 Oct 2015 10:43:58 -0400, Lew Pitcher wrote:
>>
>> But, in the military clock, there are 25 hours (00 through 24) and 60
>> minutes per hour (00 through 59). Thus, in 2600 test cases, ranging
>> sequentially from 0000 through 2599, there should be 25x60 successes 25
>> hours, with 60 values inside of the 00-59 range). That means 1500 successes
>> in 2600 test cases.
> 
> I am pretty sure that this is not the case. I have never seen "24:xx". 

Agreed that 2400 through 2459 are unusual cases. Wikipedia (always the
authoritative source :-) says
  Times after 24:00
    Time-of-day notations beyond 24:00 (such as 24:01 or 25:59 instead of
    00:01 or 01:59) are not commonly used and not covered by the relevant
    standards. However, they have been used occasionally in some special
    contexts in the UK, Japan, Hong Kong and China where business hours extend
    beyond midnight, such as broadcast television production and scheduling.
    They also appear in some public transport applications, such as Google's
    General Transit Feed Specification file format and some ticketing systems
    (e.g. in Copenhagen). This usage prevents a time period reported without
    dates from appearing to end before its beginning, e.g. 21:00–01:00.
I've sometimes had to use this timestamp range in applications, so I included
it in my test case. It looks like PHP's strtotime() function considers it to
be a valid timestamp, no matter what my (or your) opinion of it is.

> I have, however, seen "03:60". Leapseconds are rare, but happen often
> enough that code looking for valid times should account for it.

Maybe so. To me, 03:60 is as unusual as 24:30. PHP's strtotime(), however,
considers 03:60 (in any format) as "not a time value". So, perhaps
strtotime() isn't as reliable a validator for "military time" as it might
have been.


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

[toc] | [prev] | [next] | [standalone]


#15742

FromTim Streater <timstreater@greenbee.net>
Date2015-10-22 22:57 +0100
Message-ID<221020152257486870%timstreater@greenbee.net>
In reply to#15741
In article <RjcWx.106396$DK7.88540@fx02.iad>, Lew Pitcher
<lew.pitcher@digitalfreehold.ca> wrote:

>On Thursday October 22 2015 16:32, in comp.lang.php, "Peter H. Coffin"
><hellsop@ninehells.com> wrote:
>
>> On Thu, 22 Oct 2015 10:43:58 -0400, Lew Pitcher wrote:
>>>
>>> But, in the military clock, there are 25 hours (00 through 24) and 60
>>> minutes per hour (00 through 59). Thus, in 2600 test cases, ranging
>>> sequentially from 0000 through 2599, there should be 25x60 successes 25
>>> hours, with 60 values inside of the 00-59 range). That means 1500 successes
>>> in 2600 test cases.
>> 
>> I am pretty sure that this is not the case. I have never seen "24:xx". 
>
>Agreed that 2400 through 2459 are unusual cases. Wikipedia (always the
>authoritative source :-) says
>  Times after 24:00
>    Time-of-day notations beyond 24:00 (such as 24:01 or 25:59 instead of
>    00:01 or 01:59) are not commonly used and not covered by the relevant
>    standards. However, they have been used occasionally in some special
>    contexts in the UK, ...

I've never heard of this in any context. Mind you "military time" is
also generally unknown here; I've always assumed it to be a peculiarity
of the US military.

-- 
"Please stop telling us what you feel. Please stop telling us what your 
intuition is. Your intuitive feelings are of no interest whatsoever, 
and nor are mine. I don't give a bugger what you feel, or what I feel. 
I want to know what the evidence shows."             -- Richard Dawkins

[toc] | [prev] | [next] | [standalone]


#15747

FromJerry Stuckle <jstucklex@attglobal.net>
Date2015-10-22 20:22 -0400
Message-ID<n0bufg$kmh$3@dont-email.me>
In reply to#15742
On 10/22/2015 5:57 PM, Tim Streater wrote:
> In article <RjcWx.106396$DK7.88540@fx02.iad>, Lew Pitcher
> <lew.pitcher@digitalfreehold.ca> wrote:
> 
>> On Thursday October 22 2015 16:32, in comp.lang.php, "Peter H. Coffin"
>> <hellsop@ninehells.com> wrote:
>>
>>> On Thu, 22 Oct 2015 10:43:58 -0400, Lew Pitcher wrote:
>>>>
>>>> But, in the military clock, there are 25 hours (00 through 24) and 60
>>>> minutes per hour (00 through 59). Thus, in 2600 test cases, ranging
>>>> sequentially from 0000 through 2599, there should be 25x60 successes 25
>>>> hours, with 60 values inside of the 00-59 range). That means 1500
>>>> successes
>>>> in 2600 test cases.
>>>
>>> I am pretty sure that this is not the case. I have never seen "24:xx". 
>>
>> Agreed that 2400 through 2459 are unusual cases. Wikipedia (always the
>> authoritative source :-) says
>>  Times after 24:00
>>    Time-of-day notations beyond 24:00 (such as 24:01 or 25:59 instead of
>>    00:01 or 01:59) are not commonly used and not covered by the relevant
>>    standards. However, they have been used occasionally in some special
>>    contexts in the UK, ...
> 
> I've never heard of this in any context. Mind you "military time" is
> also generally unknown here; I've always assumed it to be a peculiarity
> of the US military.
> 

Military time is common to militaries throughout the world - not just
the U.S.


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#15753

FromTim Streater <timstreater@greenbee.net>
Date2015-10-23 09:19 +0100
Message-ID<231020150919238679%timstreater@greenbee.net>
In reply to#15747
In article <n0bufg$kmh$3@dont-email.me>, Jerry Stuckle
<jstucklex@attglobal.net> wrote:

>On 10/22/2015 5:57 PM, Tim Streater wrote:
>> In article <RjcWx.106396$DK7.88540@fx02.iad>, Lew Pitcher
>> <lew.pitcher@digitalfreehold.ca> wrote:
>> 
>>> On Thursday October 22 2015 16:32, in comp.lang.php, "Peter H. Coffin"
>>> <hellsop@ninehells.com> wrote:
>>>
>>>> On Thu, 22 Oct 2015 10:43:58 -0400, Lew Pitcher wrote:
>>>>>
>>>>> But, in the military clock, there are 25 hours (00 through 24) and 60
>>>>> minutes per hour (00 through 59). Thus, in 2600 test cases, ranging
>>>>> sequentially from 0000 through 2599, there should be 25x60 successes 25
>>>>> hours, with 60 values inside of the 00-59 range). That means 1500
>>>>> successes
>>>>> in 2600 test cases.
>>>>
>>>> I am pretty sure that this is not the case. I have never seen "24:xx". 
>>>
>>> Agreed that 2400 through 2459 are unusual cases. Wikipedia (always the
>>> authoritative source :-) says
>>>  Times after 24:00
>>>    Time-of-day notations beyond 24:00 (such as 24:01 or 25:59 instead of
>>>    00:01 or 01:59) are not commonly used and not covered by the relevant
>>>    standards. However, they have been used occasionally in some special
>>>    contexts in the UK, ...
>> 
>> I've never heard of this in any context. Mind you "military time" is
>> also generally unknown here; I've always assumed it to be a peculiarity
>> of the US military.

>Military time is common to militaries throughout the world - not just
>the U.S.

I'll believe you, thousands wouldn't, as my old Dad used to say. I
doubt if any civilian here would have heard of it, and the phrase never
appears in the media, either.

-- 
New Socialism consists essentially in being seen to have your heart in 
the right place whilst your head is in the clouds and your hand is in 
someone else's pocket.

[toc] | [prev] | [next] | [standalone]


#15754

FromJerry Stuckle <jstucklex@attglobal.net>
Date2015-10-23 09:32 -0400
Message-ID<n0dcpa$uns$1@dont-email.me>
In reply to#15753
On 10/23/2015 4:19 AM, Tim Streater wrote:
> In article <n0bufg$kmh$3@dont-email.me>, Jerry Stuckle
> <jstucklex@attglobal.net> wrote:
> 
>> On 10/22/2015 5:57 PM, Tim Streater wrote:
>>> In article <RjcWx.106396$DK7.88540@fx02.iad>, Lew Pitcher
>>> <lew.pitcher@digitalfreehold.ca> wrote:
>>>
>>>> On Thursday October 22 2015 16:32, in comp.lang.php, "Peter H. Coffin"
>>>> <hellsop@ninehells.com> wrote:
>>>>
>>>>> On Thu, 22 Oct 2015 10:43:58 -0400, Lew Pitcher wrote:
>>>>>>
>>>>>> But, in the military clock, there are 25 hours (00 through 24) and 60
>>>>>> minutes per hour (00 through 59). Thus, in 2600 test cases, ranging
>>>>>> sequentially from 0000 through 2599, there should be 25x60
>>>>>> successes 25
>>>>>> hours, with 60 values inside of the 00-59 range). That means 1500
>>>>>> successes
>>>>>> in 2600 test cases.
>>>>>
>>>>> I am pretty sure that this is not the case. I have never seen "24:xx". 
>>>>
>>>> Agreed that 2400 through 2459 are unusual cases. Wikipedia (always the
>>>> authoritative source :-) says
>>>>  Times after 24:00
>>>>    Time-of-day notations beyond 24:00 (such as 24:01 or 25:59
>>>> instead of
>>>>    00:01 or 01:59) are not commonly used and not covered by the
>>>> relevant
>>>>    standards. However, they have been used occasionally in some special
>>>>    contexts in the UK, ...
>>>
>>> I've never heard of this in any context. Mind you "military time" is
>>> also generally unknown here; I've always assumed it to be a peculiarity
>>> of the US military.
> 
>> Military time is common to militaries throughout the world - not just
>> the U.S.
> 
> I'll believe you, thousands wouldn't, as my old Dad used to say. I
> doubt if any civilian here would have heard of it, and the phrase never
> appears in the media, either.
> 

Well, it's used by amateur radio operators and short wave listeners
around the world, not to mention the TV and radio stations themselves,
internally.  It's also used by astronomers, physicists and other
scientists.  UTC, for instance, is almost always specified in 24 hour
format.  While more commonly called "24 hour time", people who use it
generally understand the term "military time".

And BTW - it does go from 00:00 to 24:59:59.  24:00:00 is generally
considered the end of the day and 00:00:00 the beginning of the day, but
24:00:00 - 24:59:59 is sometimes used when something goes just past the
end of the day.  Less common now than it was back in the 60's, but you
still see it occasionally.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#15755

FromTim Streater <timstreater@greenbee.net>
Date2015-10-23 15:43 +0100
Message-ID<231020151543506544%timstreater@greenbee.net>
In reply to#15754
In article <n0dcpa$uns$1@dont-email.me>, Jerry Stuckle
<jstucklex@attglobal.net> wrote:

>On 10/23/2015 4:19 AM, Tim Streater wrote:

>> I'll believe you, thousands wouldn't, as my old Dad used to say. I
>> doubt if any civilian here would have heard of it, and the phrase never
>> appears in the media, either.
>
>Well, it's used by amateur radio operators and short wave listeners
>around the world, not to mention the TV and radio stations themselves,
>internally.  It's also used by astronomers, physicists and other
>scientists.  UTC, for instance, is almost always specified in 24 hour
>format.

Plenty of people use the 24-hour clock, it's used also by railways, and
it's never referred to as anything other than the 24-hour clock.

>While more commonly called "24 hour time", people who use it
>generally understand the term "military time".

Unlikely here.

-- 
Lady Astor: "If you were my husband I'd give you poison." Churchill: "If
you were my wife, I'd drink it."

[toc] | [prev] | [next] | [standalone]


Page 1 of 7  [1] 2 3 4 5 6 7  Next page →

Back to top | Article view | comp.lang.php


csiph-web