PRInt64 r; LL_DIV(r, prdate, PR_USEC_PER_SEC);
PRInt64 r, u; LL_I2L(u, PR_USEC_PER_SEC); LL_DIV(r, prdate, u);
NET_ParseDate(char *date_string){#ifndef USE_OLD_TIME_FUNC	PRTime prdate;    time_t date = 0;    TRACEMSG(("Parsing date string: %s\n",date_string));	/* try using PR_ParseTimeString instead	 */		if(PR_ParseTimeString(date_string, TRUE, &prdate) == PR_SUCCESS)	  {        PRInt64 r;        LL_DIV(r, prdate, PR_USEC_PER_SEC);        LL_L2I(date, r);		TRACEMSG(("Parsed date as GMT: %s\n", asctime(gmtime(&date))));		TRACEMSG(("Parsed date as local: %s\n", ctime(&date)));	  }	else	  {		TRACEMSG(("Could not parse date"));	  }	return (date);#else    struct tm time_info;         /* Points to static tm structure */    char  *ip;    char   mname[256];    time_t rv;    TRACEMSG(("Parsing date string: %s\n",date_string));    memset(&time_info, 0, sizeof(struct tm));    /* Whatever format we're looking at, it will start with weekday. */    /* Skip to first space. */    if(!(ip = PL_strchr(date_string,' ')))        return 0;    else        while(NET_IS_SPACE(*ip))            ++ip;	/* make sure that the date is less than 256 	 * That will keep mname from ever overflowing 	 */	if(255 < PL_strlen(ip))		return(0);    if(isalpha(*ip)) 	  {        /* ctime */		sscanf(ip, (strstr(ip, "DST") ? "%s %d %d:%d:%d %*s %d"					: "%s %d %d:%d:%d %d"),			   mname,			   &time_info.tm_mday,			   &time_info.tm_hour,			   &time_info.tm_min,			   &time_info.tm_sec,			   &time_info.tm_year);		time_info.tm_year -= 1900;      }    else if(ip[2] == '-') 	  {        /* RFC 850 (normal HTTP) */        char t[256];        sscanf(ip,"%s %d:%d:%d", t,								&time_info.tm_hour,								&time_info.tm_min,								&time_info.tm_sec);        t[2] = '\0';        time_info.tm_mday = atoi(t);        t[6] = '\0';        PL_strcpy(mname,&t[3]);        time_info.tm_year = atoi(&t[7]);        /* Prevent wraparound from ambiguity */        if(time_info.tm_year < 70)            time_info.tm_year += 100;		else if(time_info.tm_year > 1900)			time_info.tm_year -= 1900;      }    else       {        /* RFC 822 */        sscanf(ip,"%d %s %d %d:%d:%d",&time_info.tm_mday,									mname,									&time_info.tm_year,									&time_info.tm_hour,									&time_info.tm_min,									&time_info.tm_sec);	    /* since tm_year is years since 1900 and the year we parsed 	     * is absolute, we need to subtract 1900 years from it	     */	    time_info.tm_year -= 1900;      }    time_info.tm_mon = NET_MonthNo(mname);    if(time_info.tm_mon == -1) /* check for error */		return(0);	TRACEMSG(("Parsed date as: %s\n", asctime(&time_info)));    rv = mktime(&time_info);		if(time_info.tm_isdst)		rv -= 3600;	if(rv == -1)	  {		TRACEMSG(("mktime was unable to resolve date/time: %s\n", asctime(&time_info)));        return(0);	  }	else	  {		TRACEMSG(("Parsed date %s\n", asctime(&time_info)));		TRACEMSG(("\tas %s\n", ctime(&rv)));        return(rv);	  }#endif}