TIP: Click on subject to list as thread! ANSI
echo: 4dos
to: Marc Buffet
from: Morris Turpin
date: 1998-12-10 09:23:46
subject: Daylight Saving ?

Hello Marc,

 In a message dated Dec 06 at 18:33, Marc Buffet of 2:291/725
 wrote to All:

 MB> I am searching for a batch file to set the variable acording to the  
 MB> Daylight saving time. From the last sunday of march till the last 
 MB> sunday of October it should be set as SET TZUTX=+0200 otherwhise it 
 MB> should be TZUTC=+0100

Here's the batch file that I use to dial up our local time standard and set
the time.  It also includes code to set DST as required.

Replace my +4 for your +1 and my +5 for your +2 and remove the dialup NRC
part and you should have what you're looking for.

=======================================================================
SETCLOCK.BAT - from Morris Turpin

rem Check for daylight savings time

    set realdate=%_date
    set year=%{at}substr[%_date,6,2]

rem Get Std time fallback date

    for %a in (25 26 27 28 29 30 31) do (
            date 10-%a-%year
            if "%_dow" eq "sun" set stdtmdate=%_date
            )

rem Get Daylite time jumpforward date

    for %a in (1 2 3 4 5 6 7) do (
            date 04-%a-%year
            if "%_dow" eq "sun" set daytmdate=%_date
            )
    date %realdate

rem convert all dates into comparable numbers

    set realdate=%{at}date[%realdate]
    set daytmdate=%{at}date[%daytmdate]
    set stdtmdate=%{at}date[%stdtmdate]

    iff %realdate gt %daytmdate .and. %realdate lt %stdtmdate then
            rem it's definitely Daylite savings time
            set daylite=4
    elseiff %realdate eq %daytmdate then
            rem right on daylite date
            iff %{at}time[%_time] lt %{at}time[02:00:00] then
                    set daylite=5
            else
                    set daylite=4
            endiff
    elseiff %realdate eq %stdtmdate then
            rem right on std time date
            iff %{at}time[%_time] lt %{at}time[02:00:00] then
                    set daylite=4
            else
                    set daylite=5
            endiff
    else
            rem Definitely Std time
            set daylite=5
    endiff

    unset realdate,year,stdtmdate,daytmdate

rem Begin calling NRC time beacon

    d:\utility\atsend &f2&n1s11=40 1
    echo Today is %_dow, %{at}word[%{at}eval[%_month-1],Jan Feb Mar Apr May Jun
Jul Aug Sep Oct Nov Dec] %_day, %_year
    iff %daylite=5 then
        echo System time is currently %_time Eastern Standard Time
    elseiff %daylite=4 then
        echo System time is currently %_time Eastern Daylight Savings Time
    else
        echo System time is currently %_time (Time Zone Unknown)
    endiff
    echo.
    echo preparing to call NRC for time check...
    d:\utility\nrc.exe 1 T9527729 -%daylite %_year
d:\utility\atsend z 1
    unset daylite
========================================================================


Morris Turpin
Proud Member of Team OS/2

fidonet:  1:163/307.9
internet: mturpin{at}igs.net


--- msged 2.07
* Origin: Warped in Ottawa, Canada (1:163/307.9)
SEEN-BY: 396/1 632/0 371 633/260 262 267 270 371 635/444 506 728 639/50 252
@PATH: 30769/9 163/307 99 12/12 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.