home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / acorn / tech / 691 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.9 KB  |  76 lines

  1. Path: sparky!uunet!pipex!logica!blacka
  2. From: blacka@logica.co.uk
  3. Newsgroups: comp.sys.acorn.tech
  4. Subject: problems with time on RISCOS 3.1
  5. Message-ID: <1992Nov19.193905.363@logica.co.uk>
  6. Date: 19 Nov 92 19:39:05 GMT
  7. Lines: 67
  8.  
  9. I recently discovered a number of problems in RISCOS3.1time
  10. handling
  11.   1.  C time() returns wring value if GMT is set
  12.   2.  !Alarms generate spurious time change events
  13.   3.  Time on DOS disks viewed on RISCOS is different from
  14.       PC version
  15. Has anyone else seen these?
  16.  
  17. 1.  CLIB time() function returns a date other than today.
  18.     - only  if the time is set to GMT (as opposed
  19.      to BST) using Alarm Set Clock.
  20.     The following lists the output of
  21.        *time
  22.        *today    (see C source below)
  23.  
  24.     BST
  25.         Wed,18 Nov 1992.23:28:45
  26.         18 Nov 92 23:28  ( internal 2b0ad1ad)
  27.     GMT
  28.         Wed,18 Nov 1992.22:29:08
  29.         31 Mar 94 00:57  ( internal 2d9a1fdd)
  30.  
  31. 2.   !Alarm seem somehow to create spurious time change
  32.      events (see Alarm -> Alarms ... )
  33.      The first two are genuine, the last for the 28th Feb
  34.      is !Alarms invention
  35.  
  36.     Sunday, 28th March 1993
  37.     2:00 am     This is an application alarm set by Alarm.
  38.  
  39.     Sunday, 24th October 1993
  40.     2:00 am     This is an application alarm set by Alarm.
  41.  
  42.     Monday, 28th February 1994
  43.     2:00 am     This is an application alarm set by Alarm.
  44.  
  45.  
  46. 3.  The time on DOS format disks is about half an hour
  47.     different from that read on a real P*rs*n*l C*mp*t*r
  48.  
  49.     DCG          WR/     Text      10:58:52 10-Nov-1992  460 bytes
  50.     DCG                460 10-11-92  10:13a
  51.  
  52. Andrew Black
  53.  
  54.  
  55. Source for C program
  56. --------------------
  57. #include <stdlib.h>
  58. #include <string.h>
  59. #include <time.h>
  60. #include <stdio.h>
  61.  
  62. int main(void)
  63. {
  64.  
  65.    char text [64] ;
  66.    time_t tod;  /* today */
  67.    struct tm *l;
  68.    time(&tod);
  69.  
  70.    l=localtime(&tod);   /* unpack */
  71.  
  72.    strftime(text,256,"%d %b %y %H:%M",l);
  73.    printf ("%s  ( internal %x) \n",text ,(int)tod ) ;
  74.  
  75. }
  76.