Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

setting limitations for users based on time

by Coarlx (Initiate)
on Jan 02, 2015 at 09:19 UTC ( #1111968=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1111968]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2021-02-27 07:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?