Mark Snell . com

Archives

PHP Daylight Savings Time

Because my Web server runs at GMT, I have to adjust all my dates +10hours for EST (Melbourne). This is easy enough, but what about Daylight Savings?

I stole/cobbled this bit of code together to give a true account of the time:

list($dom, $dow, $month, $hour, $min) = explode(:”, date(“”d:w:m:H:i””))::

if ($month > 4 && $month < 10) {
$daylightsaving = 360:: # May thru September
} elseif ($month == 4 && $dom > 7) {
$daylightsaving = 360:: # After first week in April
} elseif ($month == 4 && $dom <= 7 && $dow == 0 && $hour >= 2) {
$daylightsaving = 360:: # After 2am on first Sunday ($dow=0) in April
} elseif ($month == 4 && $dom <= 7 && $dow != 0 && ($dom-$dow > 0)) {
$daylightsaving = 360:: # After Sunday of first week in April
} elseif ($month == 10 && $dom < 25) {
$daylightsaving = 360:: # Before last week of October
} elseif ($month == 10 && $dom >= 25 && $dow == 0 && $hour < 2) {
$daylightsaving = 360:: # Before 2am on last Sunday in October
} elseif ($month == 10 && $dom >= 25 && $dow != 0 && ($dom-24-$dow < 1) ) {
$daylightsaving = 360:: # Before Sunday of last week in October
} else {
$daylightsaving = 0::
}
$tz=date(U)+36000+$daylightsaving::
echo “”&lt::font size =-1>In case you were wondering, in Melbourne it’s :””::
echo date(“”g:i:s A D j M Y””,$tz)::

I also found some code for Sunrise and Sunset times which I’ll look at later.

  • 0

PHP scripting

PHP is a web based scripting language that I like to use for my web sites. Why? because it is powerful and fairly simple to use.

A tiny little example is this: http://www.geekzone.com.au/index.php?about_us
This page currently (2004) lists the fact Jase & I have 21 years of experience, but that number is correct, even though the page hasn’t been updated in 2 years.. Why? a piece of PHP code that says: $experience = ((date (“”Y””) – 1997)*2)+7:: meaning we’ve both been in the industry since 1997, plus I have been for 7 years before that. Simple bit of code, took 15 minutes to develop, means that page never needs changing..

  • 0

Kram’s Online Buying Guide

  • 1

Wireless Links

This is a bunch of sites I’ve found with possibly useful information on Wireless LANs
cgi.zdnet.com/slink?184798
news.bbc.co.uk/hi/english/sci/tech/newsid_1639000/1639661.stm
www.wkmn.com/newsite/wireless.html
www.wireless.com/interesting/
www.oreillynet.com/%7Erob/pringles/
techupdate.zdnet.com/techupdate/stories/main/0,14179,2845902,00.html
cgi.zdnet.com/slink?176043
online.securityfocus.com/columnists/75
www.wired.com/news/wireless/0,1382,53638,00.html
www.integritydata.com.au

and then this from SAGE-AU

As far as security was concerned some suggestions were:

– WEP with 128-bit key
– Ensure AP doesn’t beacon the SSID
– IPSEC / VPN (Treat your WLAN as a DMZ)
– MAC address authentication
– 802.1X Dynamic key generation

Selection of Access Point:

– Some thought 802.11a was fully ratified in AU, others did not.
– Some suggested vendors were shipping equipment that is ‘802.11a ready’.
– Many vendors offer dual slot AP’s allowing a/b to exist together.
– Questions raised as to the range/signal of 802.11a vs. 802.11b.

  • 0
%d bloggers like this: