Copyright Digital Equipment Corp. All rights reserved.

Example

   The following example scales and prints a relative time.

   utc_t       relutc, scaledutc;
   struct tm   sacledreltm;
   char        timstr[UTC_MAX_STR_LEN];

   /*
    * Assume relutc contains the time to scale.
    * Scale it by a factor of 17...
    */

   utc_multime(&scaledutc,          /* Out: Scaled rel time     */
               &relutc,             /* In:  Rel time to scale   */
               17L);                /* In:  Scale factor        */

   utc_ascreltime(timstr,           /* Out: ASCII rel time      */
                  UTC_MAX_STR_LEN,  /* In:  Length of input str */
                  &scaledutc);      /* In:  Rel time to convert */

   printf("%s\n",timstr);

   /*
    *   Scale it by a factor of 17.65...
    */

   utc_mulftime(&scaledutc,         /* Out: Scaled rel time     */
                &relutc,            /* In:  Rel time to scale   */
                17.65);             /* In:  Scale factor        */

   utc_ascreltime(timstr,           /* Out: ASCII rel time      */
                  UTC_MAX_STR_LEN,  /* In:  Input str length    */
                  &scaledutc);      /* In:  Rel time to convert */

   printf("%s\n",timstr);

   /*
    *    Convert it to a tm structure and print it.
    */

   utc_reltime(&scaledreltm,        /* Out: Scaled rel tm       */
               (long *)0,           /* Out: Scaled rel nano-sec */
               (struct tm *)0,      /* Out: Scaled rel inacc tm */
               (long *)0,           /* Out: Scd rel inacc nanos */
               &scaledutc);         /* In:  Rel time to convert */

   printf("Approximately %d days, %d hours and %d minutes\n",
    scaledreltm.tm_yday, scaledreltm.tm_hour, scaledreltm.tm_min);