On Mon 3 November 2003, 1:53:58 +1000, Peter Ouwehand wrote:
> Macro-2:
> (from http://www.silverstones.com/thebat/RegexPt5.html)
> --------
> %WRAPPED='Historians believe that on %ODATE%-
> %SETPATTREGEXP="(?m-s)Date\:\s*?((.*?[\d]{4})\s*?([\d]{0,2}\:%-
> [\d]{0,2}\:[\d]{0,2})\s*?(.*))"%-
> %REGEXPBLINDMATCH="%HEADERS" , at %SUBPATT="3"[GMT%SUBPATT="4"]%-
> (which was %OTIME where I live) you wrote:'%-
>
> Results in:
> -----------
> Historians believe that on Friday, October 31, 2003 , at 18:20:34[GMT
> -0500](which was 00:20 where I live) you wrote:
>
> Which is an incorrect result.
%ODate and %OTime are working fine, it is just that %ODate has been used in a
way that links it (the date in your timezone) with the time in the sender's
timezone.
The bit that says "Historians believe that on %ODATE%-" sets the text up with
the date in your timezone. The next bit parses the headers for the time in the
sender's timezone. As you have noted, this will give an incorrect result at
times.
Here is a similar QT that I use:
---- [ ]
%WRAPPED='%SETPATTREGEXP="(?m-s)^Date:\s*(((.*?),.*?[\d]{4})\s*([\d]{0,2}:%-
[\d]{0,2}:[\d]{0,2})\s*(.*))"%-
%REGEXPBLINDMATCH="%HEADERS"%-
On %SUBPATT="2", at %SUBPATT="4" [GMT%SUBPATT="5"] %-
(which was %-
%IF:_%SUBPATT="3"_<>_%ODate="ddd"_%-
:_%ODate="ddd, hh:mm:ss"_%-
:_%ODate="hh:mm:ss"_ where I live) you wrote:'
----
This one puts the message creation date and time in the sender's timezone,
then puts in your time, preceded by your day if it differ's from the sender's.
If you want the bit about historians belive, change
On %SUBPATT="2"
to
Historians belive that on %SUBPATT="2"
--
Robin Anson
Using The Bat! v2.01.3 on Windows XP 5.1 Build 2600
Service Pack 1
________________________________________________
Current version is 2.01.3 | "Using TBUDL" information:
http://www.silverstones.com/thebat/TBUDLInfo.html