home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18641 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.3 KB  |  52 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!convex!egsner!adaptex!sdf!jjunker
  3. From: jjunker@sdf.lonestar.org (Jon Junker)
  4. Subject: Need HELP with strptime....any answers/clues?????
  5. Message-ID: <BzDJuA.AGF@sdf.lonestar.org>
  6. Organization: sdf full-shell Public Access Unix - Dallas, TX - 214/436-3281
  7. Date: Wed, 16 Dec 1992 22:58:57 GMT
  8. Lines: 42
  9.  
  10. Hi:
  11.  
  12. I have been working with some of the time functions (on a Sun
  13. SPARCstation IPX).  After I make a call to strptime (to fill 
  14. in the tm structure) I display the structure (with dbxtool) and
  15. find that the structure is filled in incorrectly.  What am I 
  16. doing wrong?
  17.  
  18. Please, e-mail me with the answer. Below is some example code.
  19.  
  20. Thanks for your time,
  21. Jon
  22. jjunker@sdf.lonestar.org
  23.  
  24.  
  25.         ---------- Example Call to AsciiToTime ----------
  26.                 :
  27.                 :
  28.                 :
  29.     timeStatus = AsciiToTime("1990,123/065301.123");
  30.                 :
  31.                 :
  32.                 :
  33.  
  34.         ---------- Module and Call in Question ----------
  35.  
  36. #include    <time.h>
  37.  
  38. AsciiToTime(timeString)
  39. char    *timeString;
  40. {
  41.     struct    tm    *my_tm;
  42.  
  43.     /* Convert time string into the time structure (my_tm) */
  44.     (void)strptime(timeString,"%Y,%j/%H%M%S",my_tm);
  45.  
  46. /* ---> After the above call to strptime the tm structure is not filled
  47.     in correctly. What am I doing wrong ??????
  48. */
  49.  
  50.     return(0);
  51. }
  52.