procmail
[Top] [All Lists]

mktime()

2004-07-01 06:09:10
Toen wij Dallman Ross kietelden, kwam er dit uit:

# Compare asserted date against date and time received, look for phoniness


 :0  # 030503 () find hour of delivery, assign to $HH_
  * FROM_  ??  ()\/[0-2][0-9]:
  * MATCH  ??  ^^\/..
  { HH_ = ${MATCH}00 }

 :0  # 030504 () sum TZ offset and arrival hour to find nominal day
  * $        $HH_^0
  * $  $TZ_OFFSET^0
  { } POST_HH_ = $=

     :0 E  # 030504 () we're at "yesterday": $POST_HH_ was negative
      *         2400^0
      * $  $POST_HH_^0
      { YESTERDAY = $TRUE   POST_HH_ = $= }

     :0 E  # 030504 () else test for hour-wrap taking us to "tomorrow"
      * $  $POST_HH_^0
      *        -2400^0
      { TOMORROW  = $TRUE   POST_HH_ = $= }

I have an mktime() that is almost ready. It will not do TAI and leap-seconds 
etc., just plain seconds-since-197001010000.00 

I want to use it for a variant on grey-listing, if I find the time to 
set that up.

Some preliminary code:

  MM    = 10 # Oct

  MAXSC = 2147483647
  dot = .

# Seconds_Per_miNute/Hour/Day/Year
  SPN =       60
  SPH =     3600
  SPD =    86400
  SPY = 31536000

# cumulative Days_Per_Month
  DPM = "(0,31,59,90,120,151,181,212,243,273,304,334,365)"

  dm = 0
  :0
  *$   -$MM^0
  *$ $MAXSC^0
  *$      1^1 DPM ?? [^0-9]\/[0-9]+
  { dm = $MATCH }  # cum.days until prev.month

  :0
  *  -1970^0
  *$ $YYYY^0
  { } yd = $=  # YYYY - 1970

etc. :)   (URL follows)

-- 
Grtz, Ruud

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>