#!/usr/bin/perl -w # wlofie/w0nderer # wlofie at yahoo dot com # this script makes no provisions for weekday name, monthday name or # summer winter (daylight savings) it's just made to # make "human readable zeropadded y2k 'safe'" dates ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime(time); sub correction { #correct and "zero pad" the date #i know it looks like shit..i'll pretty it up late with a nice little loop # "foreach" and put the vars in an array sounds about my speed if ($sec<10) { $sec="0$sec"; } if ($min<10) { $min="0$min"; } if ($hour<10) { $hour="0$hour"; } if ($mday<10) { $mday="0$mday"; } if (++$mon<10) { $mon="0$mon"; } #now we fix the year (yes if the supporting libs give 102 normally for # year this value is now y2k i think...maybe..no warranty) $year=$year-100+2000; } correction(); print "sec: $sec\nmin: $min\nhour: $hour\nmday: $mday\nmon: $mon\nyear: $year\nwday: $wday\nyday: $yday\nisdst: $isdst\n";