Re: origindate from header instead of %ODATE

2003-08-02 Thread Bill McCarthy
On Fri 1-Aug-03 1:07pm -0400, Mark Wieder wrote:

 Thursday, July 31, 2003, 5:43:10 PM, you wrote:

BM What we could use is for Stefan to call GetTimeZoneInformation and
BM give us access to a %Standard or %Daylight macro.

 GetTimeZoneInformation only returns information about the current
 system time.

You're right, it would be useful only if one accepts the wrong answer
for a short time every six months.  Since this happens only on
replying to email, manually changing the result is not much of a
burden.

It's easy to determine the change dates for any year in the current
century.  For example, if 'y' is the last 2 digits of the year, the
first Sunday of April is on day = 1 + (127 - y - (y - y\4) / 4) \ 7.

However, it does not appear possible to accurately produce the correct
offset for any time.  The problem is that, on the change date in the
fall, 01:00:00 through 01:59:59 could be either standard of daylight
time.

Perhaps, I should use 3 offsets: -500 for standard time, -400 for
daylight time and -4or5 for that indeterminate hour :-)

-- 
Best regards,
Bill



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-08-02 Thread Thomas Fernandez
Hello Bill,

On Sat, 2 Aug 2003 14:02:21 -0400 GMT (03/08/2003, 01:02 +0700 GMT),
Bill McCarthy wrote:

 Perhaps, I should use 3 offsets: -500 for standard time, -400 for
 daylight time and -4or5 for that indeterminate hour :-)

I'm not sure I read the beginning of this thread. But this is my
macro:

On%SETPATTREGEXP=(?m-s)Date\:\s*?((.*?[\d]{4})\s*?([\d]{0,2}\:[\d]{0,2})\s*?(.*))%-
%REGEXPMATCH=%HEADERS GMT (%ODateShort, %OTime +0700 GMT),
%OFROMNAME wrote:

So my time zone (+0700 GMT) is hard coded, because we have 12 months
of summer every year and have no need for daylight savings time. But I
wouldn't see a problem changing that manually twice a year. ;-)

-- 

Cheers,
Thomas.

Moderator der deutschen The Bat! Beginner Liste.

Alexander Strehmel (Unterhaching): Gerade in einem Spiel, wo die
Nerven blank liegen, muss man sein wahres Gesicht zeigen und die Hosen
runterlassen.

Message reply created with The Bat! 2.0 Beta/1
under Chinese Windows 98 4.10 Build  A 
using a Pentium P4 1.7 GHz, 128MB RAM




Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-08-02 Thread Dan Grunberg
Thu, 31 Jul 2003 20:43:10 [GMT -0400] (8:43 PM EDT here) Bill McCarthy
wrote:

 On Thu 31-Jul-03 4:05pm -0400, Marck D Pearlstone wrote:

 @31-Jul-2003, 15:23 -0400 (20:23 UK time) Bill McCarthy [BM] in
 mid:[EMAIL PROTECTED] said to Marck:

BM I would like to programmatically have my local offset change.
BM But now I manually change between -400 to -500 twice a year. The
BM local offset of the sender doesn't help :-(

I'm late to the thread but...

I do not have to change time zones manually, the D or S in my time
zone and my local time is generated AUTOMATICALLY. My local day that
corresponds to the day and date of the original message also is
calculated. Many months ago ago, Januk Aggarwal wrote the system of
six templates that generates the first line of my replies (see above).

I don't know the details of how everything works, because I foolishly
deleted Januk's e-mails. I do know that Januk crafted the templates to
work properly even for half-hour offset time zones. The only problem
I know of is that neither D nor S is generated when replying to
an AOL user's e-mail, because AOL's e-mail program handles time
differently from all(?) other e-mail programs.

If there is interest, I'll happily post Januk's templates here.
(Hint: Perhaps someone can solve the AOL anomaly.)


Using The Bat! v1.62r 
on Windows 2000 5.0 Build 2195Service Pack 4



-- 

Daniel A. Grunberg   Kensington, Maryland, USA
homepage: www.nyx.net/~dgrunber/



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-08-02 Thread Mark Wieder
Bill-

Saturday, August 2, 2003, 11:02:21 AM, you wrote:

BM You're right, it would be useful only if one accepts the wrong answer
BM for a short time every six months.  Since this happens only on
BM replying to email, manually changing the result is not much of a
BM burden.

My point, though, is that despite the large amount of data returned by
a call to GetTimeZoneInformation, none of it us useful in determining
whether a specified date is in standard or daylight savings time.
Doesn't matter whether you're talking about yesterday or a week ago or
an hour ago. GetTimeZoneInformation only deals with the Right Now time
and there's no way to plug any other date information into it.

At any rate, methinks if you have to worry about whether a reply was
created between 1AM and 2AM on a certain Sunday in October, you either
have way too much time on your hands or you need to get out in the
real world a bit more... g

-Mark Wieder

 Using The Bat! v1.63 Beta/7 on Windows 2000 5.0 Build 2195 Service Pack 2
-- 



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-08-02 Thread Bill McCarthy
On Sat 2-Aug-03 8:52pm -0400, Mark Wieder wrote:

 GetTimeZoneInformation only deals with the Right Now time and
 there's no way to plug any other date information into it.

I understand.  I rarely reply to email that isn't from today or
yesterday.  There would only be 2 days a year that my offset would be
wrong.  Nothing I'd worry about :-)'

 At any rate, methinks if you have to worry about whether a reply was
 created between 1AM and 2AM on a certain Sunday in October, you either
 have way too much time on your hands or you need to get out in the
 real world a bit more... g

Ha!  Normally, I wouldn't care - but for any code I write, I like it
to be correct.

-- 
Best regards,
Bill



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-08-02 Thread Greg Strong
Hello Bill,

 At any rate, methinks if you have to worry about whether a reply was
 created between 1AM and 2AM on a certain Sunday in October, you
 either have way too much time on your hands or you need to get out in
 the real world a bit more... g

 Ha!  Normally, I wouldn't care - but for any code I write, I like it
 to be correct.

Taking ownership!  :-)

-- 
Best regards,

Greg Strong 
TB! v2.0 Beta/1 on Windows XP Service Pack 1



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-08-01 Thread Mark Wieder
Bill-

Thursday, July 31, 2003, 5:43:10 PM, you wrote:

BM What we could use is for Stefan to call GetTimeZoneInformation and
BM give us access to a %Standard or %Daylight macro.

...veering wildly off topic and expecting a trout...

Have you looked at the mess that API MS has created there?
GetTimeZoneInformation only returns information about the current
system time. In order to generalize about the offset for a given
location and time you first have to call the API to determine whether
or not DST is honored, then look up the offset if it is. Then, on your
own (no API calls available for this), you need to determine if the
date in question is within the DST period, and finally apply the
offset.

The other way around it would be to set your system time temporarily
to the date in question, call the API, and restore the system time.
I've actually seen code that uses this approach.

...we now return you to an appropriate TBUDL topic...

-Mark Wieder

 Using The Bat! v1.63 Beta/7 on Windows 2000 5.0 Build 2195 Service Pack 2
-- 



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


origindate from header instead of %ODATE

2003-07-31 Thread daniel hahler
Hi all.

I would like to extract the Date and Time from the email header's
Date: line (to have GMT info) and came up with this (by finding a
more complex one and simplying it):

--+
%SETPATTREGEXP=(?m-s)Date\:\s*(.*)%REGEXPBLINDMATCH=%HEADERS
on %SUBPATT=1 you wrote:
--+

I don't know what the m and s is for at the beginning, but it works..

as I'm not used to RegExps, I would like to ask you to give me
comments about what's wrong or could be done simplier.

TIA!


-- 
shinE!
Using The Bat! v1.62r on Windows XP 5.1 Build  2600
Service Pack 1
http://www.thequod.de ICQ#152282665



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-07-31 Thread Bill McCarthy
On Thu 31-Jul-03 10:08am -0400, daniel hahler wrote:

[Yours (and my modified version) produces]:
on Thu, 31 Jul 2003 16:08:07 +0200 you wrote:

 --+
 %SETPATTREGEXP=(?m-s)Date\:\s*(.*)%REGEXPBLINDMATCH=%HEADERS
 on %SUBPATT=1 you wrote:
 --+

 I don't know what the m and s is for at the beginning, but it works..

(?m) gives you multi-line, so ^ and $ refer to the beginning and end
of lines.  Without it, they refer to the beginning and end of the
whole text (in this case %Headers).  Note, your original doesn't rely
on this option - my modification does.

(?-s) restricts '.' to not include newline characters - so your (.*)
only extends to the end of the line.  This is required here.

For more detail see Internal Option Setting under Regex.

 as I'm not used to RegExps, I would like to ask you to give me
 comments about what's wrong or could be done simplier.

The Date field starts must start a line, so replace 'Date' with
'^Date'.

The ':' is not special, so replace '\:' with ':' - not a required
change - just looks better.

The Date: field must be followed by white space, so replace '\s*' with
'\s+'.

You introduce 2 newlines, where only one is likely desirable.
Replace '%Headers' with '%Headers%-'

Combining the above, I'd write:

%SetPattRegExp=(?m-s)^Date:\s+(.*)%RegExpBlindMatch=%Headers%-
on %SubPatt=1 you wrote:

Note that for mailing list replies, it's best not to use 'you'.

-- 
Best regards,
Bill



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re[2]: origindate from header instead of %ODATE

2003-07-31 Thread daniel hahler
on Thu, 31 Jul 2003 11:19:57 -0400, Bill McCarthy wrote:

BM On Thu 31-Jul-03 10:08am -0400, daniel hahler wrote:

snip

BM Combining the above, I'd write:
BM %SetPattRegExp=(?m-s)^Date:\s+(.*)%RegExpBlindMatch=%Headers%-
BM on %SubPatt=1 you wrote:

BM Note that for mailing list replies, it's best not to use 'you'.

ok, changed that. Thanks a lot.

But I'm wondering how you get the comma out in your opening line.. do
you regexp it away?


-- 
shinE!
Using The Bat! v1.62r on Windows XP 5.1 Build  2600
Service Pack 1
http://www.thequod.de ICQ#152282665



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-07-31 Thread Thomas Fernandez
Hello daniel,

On Thu, 31 Jul 2003 19:10:10 +0200 GMT (01/08/03, 00:10 +0700 GMT),
daniel hahler wrote:

 But I'm wondering how you get the comma out in your opening line.. do
 you regexp it away?

There is no comma (denial is the best defense). ;-)

I use this one (mostly thanks to helpers fromthis list), as most
contributors to lists are on another time zone than I am:

On%SETPATTREGEXP=(?m-s)Date\:\s*?((.*?[\d]{4})\s*?([\d]{0,2}\:[\d]{0,2})\s*?(.*))%-
%REGEXPMATCH=%HEADERS GMT (%ODateShort, %OTime +0700 GMT),
%OFROMNAME wrote:

You see the result above. Please note that you have to change the
hardcoded +0700 to your time zone (+0200). Oops, and I have hardcoded
a comma.

-- 

Cheers,
Thomas.

Moderator der deutschen The Bat! Beginner Liste.

Um zu antworten, bitte die From-Zeile mit ROT13 bearbeiten. Danach mit
MD5 hashen, zeichenweise den ASCII-Code um 2 erhoehen (mod 57) und
erneut um 63 erhoehen. Dann mit der urspruenglichen Adresse x-oren.
Schliesslich am Ergebnis erfreuen und so antworten wie gewohnt.

Message reply created with The Bat! 1.63 Beta/5
under Chinese Windows 98 4.10 Build  A 
using a Pentium P4 1.7 GHz, 128MB RAM



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-07-31 Thread Marck D Pearlstone
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Bill,

@31-Jul-2003, 13:45 -0400 (18:45 UK time) Bill McCarthy [BM] in
mid:[EMAIL PROTECTED] said to daniel:

BM On %ODate=ddd d-mmm-yy %OTime=h:mm''am/pm -0400,
... snip
BM The downside is that I need to change the offset twice a year.

,--/ My TMZONE QT \--
| %SETPATTREGEXP=(?m-s)^Date:.*\d\d:\d\d:\d\d.*([+-]\d\d\d\d)%-
| %REGEXPBLINDMATCH=%HEADERS%SUBPATT=1
`-8-

does it for me. :-).

- --
Cheers -- .\\arck D Pearlstone -- List moderator
TB! v1.63 Beta/11 on Windows XP 5.1.2600 Service Pack 1

-BEGIN PGP SIGNATURE-
Version: PGPsdk version 1.7.1 (C) 1997-1999 Network Associates, Inc. and its 
affiliated companies.

iQA/AwUBPylhsznkJKuSnc2gEQJy6ACg87WVnIcyRZN7s2rlamK4P4JUFscAn0Cx
43JxQUeDEKOHPKHXxzpgOcPI
=7uVi
-END PGP SIGNATURE-




Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-07-31 Thread Bill McCarthy
On Thu 31-Jul-03 2:36pm -0400, Marck D Pearlstone wrote:

 @31-Jul-2003, 13:45 -0400 (18:45 UK time) Bill McCarthy [BM] in
 mid:[EMAIL PROTECTED] said to daniel:

BM On %ODate=ddd d-mmm-yy %OTime=h:mm''am/pm -0400,
 ... snip
BM The downside is that I need to change the offset twice a year.

 ,--/ My TMZONE QT \--
 | %SETPATTREGEXP=(?m-s)^Date:.*\d\d:\d\d:\d\d.*([+-]\d\d\d\d)%-
 | %REGEXPBLINDMATCH=%HEADERS%SUBPATT=1
 `-8-

 does it for me. :-).

Your TMZONE QT appears to pick up the local time zone of the sender.
As you can see, I use my own local time (see 1st line above).  Since I
show my local offset, a reader can easily convert to his/her own time
zone.

I would like to programmatically have my local offset change.  But now
I manually change between -400 to -500 twice a year.  The local offset
of the sender doesn't help :-(

-- 
Best regards,
Bill



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-07-31 Thread Marck D Pearlstone
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Bill,

@31-Jul-2003, 15:23 -0400 (20:23 UK time) Bill McCarthy [BM] in
mid:[EMAIL PROTECTED] said to Marck:

BM The downside is that I need to change the offset twice a year.

 ,--/ My TMZONE QT \--
 | %SETPATTREGEXP=(?m-s)^Date:.*\d\d:\d\d:\d\d.*([+-]\d\d\d\d)%-
 | %REGEXPBLINDMATCH=%HEADERS%SUBPATT=1
 `-8-

 does it for me. :-).

BM Your TMZONE QT appears to pick up the local time zone of the sender.

You're right. I used to specify my TZ, but instead say UK time
these days. I had forgotten that I had changed it.

BM I would like to programmatically have my local offset change.
BM But now I manually change between -400 to -500 twice a year. The
BM local offset of the sender doesn't help :-(

No, it wouldn't. I suppose you could query the month like this:

%if:'%Date=m''4':'0500':'%-
%if:_%Date=m__11_:_0400_:_0500_'%-

Just refine if for the month of change and test for the day and
you're done.

- --
Cheers -- .\\arck D Pearlstone -- List moderator
TB! v1.63 Beta/11 on Windows XP 5.1.2600 Service Pack 1

-BEGIN PGP SIGNATURE-
Version: PGPsdk version 1.7.1 (C) 1997-1999 Network Associates, Inc. and its 
affiliated companies.

iQA/AwUBPyl2oznkJKuSnc2gEQLcUQCffwiKigipulBf/RYzsFbqxKlt8sgAnRmf
BzK/t8rUhEX3zIr2G1ojWZC7
=QvgE
-END PGP SIGNATURE-




Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-07-31 Thread Bill McCarthy
On Thu 31-Jul-03 4:05pm -0400, Marck D Pearlstone wrote:

 @31-Jul-2003, 15:23 -0400 (20:23 UK time) Bill McCarthy [BM] in
 mid:[EMAIL PROTECTED] said to Marck:

BM I would like to programmatically have my local offset change.
BM But now I manually change between -400 to -500 twice a year. The
BM local offset of the sender doesn't help :-(

 No, it wouldn't. I suppose you could query the month like this:

 %if:'%Date=m''4':'0500':'%-
 %if:_%Date=m__11_:_0400_:_0500_'%-

 Just refine if for the month of change and test for the day and
 you're done.

Remember, the rules in the states are 2am on the 1st Sunday of April
and the last Sunday of October.  Rather nasty in TB for a general
solution - although a bit easier to do in the beta.

What we could use is for Stefan to call GetTimeZoneInformation and
give us access to a %Standard or %Daylight macro.

-- 
Best regards,
Bill



Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: origindate from header instead of %ODATE

2003-07-31 Thread Marck D Pearlstone
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Bill,

@31-Jul-2003, 20:43 -0400 (01:43 UK time) Bill McCarthy [BM] in
mid:[EMAIL PROTECTED] said to Marck:

 Just refine if for the month of change and test for the day and
 you're done.

BM Remember, the rules in the states are 2am on the 1st Sunday of
BM April and the last Sunday of October.  Rather nasty in TB for a
BM general solution - although a bit easier to do in the beta.

BM What we could use is for Stefan to call GetTimeZoneInformation
BM and give us access to a %Standard or %Daylight macro.

What I always do for stuff like this is to break it down and
encapsulate it in QT bitlets. It makes it easier to maintain and
follow. It's certainly feasible.

- --
Cheers -- .\\arck D Pearlstone -- List moderator
TB! v1.63 Beta/11 on Windows XP 5.1.2600 Service Pack 1

-BEGIN PGP SIGNATURE-
Version: PGPsdk version 1.7.1 (C) 1997-1999 Network Associates, Inc. and its 
affiliated companies.

iQA/AwUBPym7NTnkJKuSnc2gEQKAYgCfTfHuTuRRNvlGWKkSpyC/k9kVYikAnRFS
0Naqz3027Jiy5OHU33uZQcoE
=seQI
-END PGP SIGNATURE-




Current version is 1.62r | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html