Coarlx has asked for the wisdom of the Perl Monks concerning the following question:

I am writing a time clock, but the problem i am having is that i want to allow the user to clock in 5 mins before the hour begins.I honestly have no idea how to do this i have been trying all the different modules i just may not be doing it in the correct manner.

  • Comment on setting limitations for users based on time

Replies are listed 'Best First'.
Re: setting limitations for users based on time
by marto (Cardinal) on Jan 02, 2015 at 09:52 UTC

    Welcome, please read and understand How do I post a question effectively?, it's better if you show people what you tried and explain how it failed. Below is an example of what I think you're looking for.

    #!/usr/bin/perl use strict; use warnings; use DateTime; my $dt = DateTime->now; my $minute = $dt->minute; if ( $minute >= 55 ){ print "It's within 5 minutes of an hour\n"; }else{ print "No clock in for you!\n"; }
Re: setting limitations for users based on time
by Anonymous Monk on Jan 02, 2015 at 09:31 UTC
    What did you try?
A reply falls below the community's threshold of quality. You may see it by logging in.