diff mbox

testsuite ltime_gmtime tweak

Message ID 20100730054142.GM16715@bubble.grove.modra.org
State New
Headers show

Commit Message

Alan Modra July 30, 2010, 5:41 a.m. UTC
I've had this in my tree for years, living as I do in one of the few
regions of the world so backward we have a half-hour timezone.  OK to
apply?

	* gfortran.dg/ltime_gmtime_1.f90: Tolerate half-hour timezones.
	* gfortran.dg/ltime_gmtime_2.f90: Likewise.

Comments

Steve Kargl July 30, 2010, 6:10 a.m. UTC | #1
On Fri, Jul 30, 2010 at 03:11:42PM +0930, Alan Modra wrote:
> I've had this in my tree for years, living as I do in one of the few
> regions of the world so backward we have a half-hour timezone.  OK to
> apply?
> 
> 	* gfortran.dg/ltime_gmtime_1.f90: Tolerate half-hour timezones.
> 	* gfortran.dg/ltime_gmtime_2.f90: Likewise.
> 

Yes.
Toon Moene July 30, 2010, 5:42 p.m. UTC | #2
Alan Modra wrote:

> I've had this in my tree for years, living as I do in one of the few
> regions of the world so backward we have a half-hour timezone.  OK to
> apply?

India ?

Not that I would consider that country backward ...

According to Wikipedia:

Time Zone: IST (UTC + 5:30).
Dave Korn July 30, 2010, 7:06 p.m. UTC | #3
On 30/07/2010 18:42, Toon Moene wrote:
> Alan Modra wrote:
> 
>> I've had this in my tree for years, living as I do in one of the few
>> regions of the world so backward we have a half-hour timezone.  OK to
>> apply?
> 
> India ?

  Heh, where did you get that from?

> Date: Fri, 30 Jul 2010 15:11:42 +0930
> From: Alan Modra 

  UTC +0930 = Aus central standard time :)


    cheers,
      DaveK
N.M. Maclaren July 30, 2010, 7:39 p.m. UTC | #4
On Jul 30 2010, Dave Korn wrote:
>On 30/07/2010 18:42, Toon Moene wrote:
>> Alan Modra wrote:
>> 
>>> I've had this in my tree for years, living as I do in one of the few
>>> regions of the world so backward we have a half-hour timezone.  OK to
>>> apply?
>> 
>> India ?
>
>  UTC +0930 = Aus central standard time :)

There are places with quarter-hour time zones, and some with solar time,
though I don't believe that any of those are concerned about computer
time-stamps.  However, I could well be wrong in that.

Regards,
Nick Maclaren.
Jakub Jelinek July 30, 2010, 7:51 p.m. UTC | #5
On Fri, Jul 30, 2010 at 08:39:21PM +0100, N.M. Maclaren wrote:
> On Jul 30 2010, Dave Korn wrote:
> >On 30/07/2010 18:42, Toon Moene wrote:
> >>Alan Modra wrote:
> >>
> >>>I've had this in my tree for years, living as I do in one of the few
> >>>regions of the world so backward we have a half-hour timezone.  OK to
> >>>apply?
> >>
> >>India ?
> >
> > UTC +0930 = Aus central standard time :)
> 
> There are places with quarter-hour time zones, and some with solar time,

Yep, Australia/Eucla and Pacific/Chatham.

> though I don't believe that any of those are concerned about computer
> time-stamps.  However, I could well be wrong in that.

I think we can ignore Solar* zones, but probably would be good if that %30
was %15 instead.

	Jakub
Paul Koning July 30, 2010, 7:56 p.m. UTC | #6
On Jul 30, 2010, at 3:51 PM, Jakub Jelinek wrote:

> On Fri, Jul 30, 2010 at 08:39:21PM +0100, N.M. Maclaren wrote:
>> On Jul 30 2010, Dave Korn wrote:
>>> On 30/07/2010 18:42, Toon Moene wrote:
>>>> Alan Modra wrote:
>>>> 
>>>>> I've had this in my tree for years, living as I do in one of the few
>>>>> regions of the world so backward we have a half-hour timezone.  OK to
>>>>> apply?
>>>> 
>>>> India ?
>>> 
>>> UTC +0930 = Aus central standard time :)
>> 
>> There are places with quarter-hour time zones, and some with solar time,
> 
> Yep, Australia/Eucla and Pacific/Chatham.

Also Nepal.
> 
>> though I don't believe that any of those are concerned about computer
>> time-stamps.  However, I could well be wrong in that.
> 
> I think we can ignore Solar* zones, but probably would be good if that %30
> was %15 instead.

%15 would be sufficient if you only need to worry about currently existing timezones.  If you want historic ones as well then life gets much weirder.  There are some 20 minute offsets as recently as 1951, for example.

	paul
N.M. Maclaren July 30, 2010, 9:04 p.m. UTC | #7
On Jul 30 2010, Paul Koning wrote:
>
> %15 would be sufficient if you only need to worry about currently 
> existing timezones. If you want historic ones as well then life gets much 
> weirder. There are some 20 minute offsets as recently as 1951, for 
> example.

I think that, like solar time, that can be ignored.  I am not absolutely
sure, but I think that I have lived in a country with no official time.
I am certain that nobody actually used an official time if it had one,
because there were no railways, and telephone calls had to be booked
days ahead of time and were seriously unreliable.  Even from the few
places that HAD telephones!

Assuming time zones that are a multiple of 15 minutes covers as many
cases as are worth attempting to cover.

Regards,
Nick Maclaren.
diff mbox

Patch

Index: gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90	(revision 162669)
+++ gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90	(working copy)
@@ -5,5 +5,5 @@ 
   t = time()
   call ltime(t,x)
   call gmtime(t,y)
-  if (x(1) /= y(1) .or. x(2) /= y(2)) call abort
+  if (x(1) /= y(1) .or. mod(x(2),30) /= mod(y(2),30)) call abort
   end
Index: gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90
===================================================================
--- gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90	(revision 162669)
+++ gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90	(working copy)
@@ -5,5 +5,5 @@ 
   t = time()
   call ltime(t,x)
   call gmtime(t,y)
-  if (x(1) /= y(1) .or. x(2) /= y(2)) call abort
+  if (x(1) /= y(1) .or. mod(x(2),30) /= mod(y(2),30)) call abort
   end