Gossamer Forum
Home : Products : DBMan : Customization :

Re: Search time on the time of the search

Quote Reply
Re: Search time on the time of the search In reply to
Yes, I can make those modifications to the database. :)
But instead of making the time into military time, is there a way I can make a subroutine that can convert the time into what military time and stuff?

This is a fake code I am just typing.
Example:

sub get_day {
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time());
my (@day) = qw!Sun Mon Tue Wed Thu Fri Sat!;
return "$day[$dweek]";
}

sub convert_time_to_military {
# $hour:$min $ampm , this is the way the values are in.
# is there anyway to assign the first two value as $hour
# the next one as junk and the next two as $min and
# the next one as junk and the last two as $ampm?
# ex. "scott wa", and $hour = "sc", $min = "tt", $ampm = "wa"?
my ($hour, $min, $ampm) = $in{$get_day+_open};
if (($hour == "12") && ($ampm == "AM")) {return "24$min";}
else if (($hour == "12") && ($ampm == "PM")) {return "12$min";}
# For "24 hours"
else if ($hour == "24") {return "-2";}
# For "Closed"
else if ($hour == "Cl") {return "-1";}
else ($ampm == "PM") {$hour = $hour + 12; return "$hour$min";}
}
I want the code above to find out what day of the week it is and to convert the time to military, like 12:00 AM to 2400.

If this cannot be done or it is tedious and slow for the computer, than can I have a way of displaying 12:00 AM from the military time of 2400, like soemthing in html.pl?

Thank you so much for replying to me and helping me.

Scott Wang


Subject Author Views Date
Thread Search time on the time of the search wangs 4038 Jul 3, 2000, 2:05 AM
Thread Re: Search time on the time of the search
JPDeni 3955 Jul 3, 2000, 3:18 AM
Thread Re: Search time on the time of the search
wangs 3941 Jul 3, 2000, 8:01 PM
Thread Re: Search time on the time of the search
JPDeni 3954 Jul 4, 2000, 1:33 AM
Thread Re: Search time on the time of the search
wangs 3939 Jul 4, 2000, 2:49 AM
Thread Re: Search time on the time of the search
JPDeni 3914 Jul 4, 2000, 4:31 AM
Thread Re: Search time on the time of the search
wangs 3944 Jul 4, 2000, 6:20 AM
Thread Re: Search time on the time of the search
JPDeni 3933 Jul 4, 2000, 6:49 AM
Thread Re: Search time on the time of the search
wangs 3925 Jul 4, 2000, 3:31 PM
Thread Re: Search time on the time of the search
JPDeni 3919 Jul 5, 2000, 10:04 AM
Thread Re: Search time on the time of the search
wangs 3941 Jul 5, 2000, 11:24 AM
Thread Re: Search time on the time of the search
JPDeni 3927 Jul 5, 2000, 11:36 AM
Thread Re: Search time on the time of the search
wangs 3909 Jul 5, 2000, 11:52 AM
Thread Re: Search time on the time of the search
wangs 3924 Jul 5, 2000, 11:54 AM
Thread Re: Search time on the time of the search
wangs 3940 Jul 5, 2000, 12:00 PM
Thread Re: Search time on the time of the search
JPDeni 3917 Jul 5, 2000, 12:08 PM
Post Re: Search time on the time of the search
wangs 3917 Jul 5, 2000, 12:14 PM