处理日期以衡量是否“有效".或不 [英] Handling date to measure if "is working" or not

查看:68
本文介绍了处理日期以衡量是否“有效".或不的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个与雇员有关的字段:

$ enter和$ leave("08:00"和"18:00").

我想知道的是,如果该人员当前正在现在"工作.

我该如何处理?

我是这样做的:

I have two field related to an employee:

$enter and $leave (''08:00'' and ''18:00'').

What I want to know, is that if that person is working "now" at current minute.

How can I handle this?

I did it this way:

$x = "18:00";
$y = "22:00";

//list($hour_enter,$minute_enter)= split('[:]', $x);
list($hour_leave,$minute_leave)= split('[:]', $y);

date_default_timezone_set('Europe/Lisbon');

$now= gmdate("H");
$z = $hour_leave-$now;

if($z > 0)
    echo "he's still working";
else
    echo "he already left";

推荐答案

输入并


离开("08:00"和"18:00" ).

我想知道的是,如果该人员当前正在现在"工作.

我该如何处理?

我是这样做的:

leave (''08:00'' and ''18:00'').

What I want to know, is that if that person is working "now" at current minute.

How can I handle this?

I did it this way:


x = " 18:00";
x = "18:00";


这篇关于处理日期以衡量是否“有效".或不的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆