Re: [freenet-chat] Quick C Question

2001-05-03 Thread David McNab

> libfreenet includes an old-style dbr implementation. But you're wasting
> your time writing for the old "standard."

Already finished implementing support for the old standard.
The parsing engine will transparently support both old and new standards

- Original Message -
From: "Mark J. Roberts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 04, 2001 12:39 AM
Subject: Re: [freenet-chat] Quick C Question


> On Fri, 4 May 2001, David McNab wrote:
>
> > But is there an equivalent function which converts a *GMT* time in
> > (struct tm) format into seconds since the epoch GMT?
>
> No. You can use the global timezone var to correct th.tm_hour (the strange
> results will be normalized by mktime; run localtime() to set timezone).
>
> libfreenet includes an old-style dbr implementation. But you're wasting
> your time writing for the old "standard."
>
>
> --
> "...you have mistaken your cowardice for common sense
>  and have found comfort in that, deceiving yourselves."
> Mark Roberts | [EMAIL PROTECTED]
>
>
> ___
> Chat mailing list
> [EMAIL PROTECTED]
> http://lists.freenetproject.org/mailman/listinfo/chat
>


___
Chat mailing list
[EMAIL PROTECTED]
http://lists.freenetproject.org/mailman/listinfo/chat



Re: [freenet-chat] Quick C Question

2001-05-03 Thread Mark J. Roberts

On Fri, 4 May 2001, David McNab wrote:

> But is there an equivalent function which converts a *GMT* time in
> (struct tm) format into seconds since the epoch GMT?

No. You can use the global timezone var to correct th.tm_hour (the strange
results will be normalized by mktime; run localtime() to set timezone).

libfreenet includes an old-style dbr implementation. But you're wasting
your time writing for the old "standard."


-- 
"...you have mistaken your cowardice for common sense
 and have found comfort in that, deceiving yourselves."
Mark Roberts | [EMAIL PROTECTED]


___
Chat mailing list
[EMAIL PROTECTED]
http://lists.freenetproject.org/mailman/listinfo/chat



[freenet-chat] Quick C Question

2001-05-03 Thread David McNab



We all know the mktime() function, which converts a 
*local* time in (struct tm) format into seconds since the epoch 
GMT.
 
But is there an equivalent function which converts 
a *GMT* time in (struct tm) format into seconds since the epoch 
GMT?
 
On windoze, I found an undocumented function hiding 
in library source called _mkgmtime() which does this 
perfectly. 
But I don't want to lose portability. Is there a 
similar function in Linux-land?
 
I ask because I've been hitting all kinds of snags 
with handling the 'mmddhhmmss'-format times in FCP.
Many or most DBRs use Jan 1, 2000, 00:00:00 as the 
baseline.
The 'fun' happens in the Southern Hemisphere, where 
at that time, localtime is one hour ahead with Daylight Saving.
That plays havoc with the date 
calculation.
I tried setting TZ to zero, then doing a tzset(). 
But then time() becomes inaccurate, because it takes the system clock to be 
GMT!
 
I'd rather not have to reinvent the wheel by 
writing yet another "compute the number of days between two dates" function, 
plus the pain of timezones, and determining whether it's daylight saving now, 
and was it daylight saving in the place and time of the DBR baseline 
AAARRRGG!
 
Cheers
David