-
Notifications
You must be signed in to change notification settings - Fork 7
Home
Md Rasheduzzaman edited this page May 2, 2024
·
1 revision
static public function getTodaysRecords(ZKTeco $self)
{
// Get all attendance records from the device
$attendanceData = self::get($self);
// Get today's date
$currentDate = date('Y-m-d');
// Filter attendance data for today
$todaysAttendance = array_filter($attendanceData, function($record) use ($currentDate) {
// Assuming the date format in the attendance data is 'Y-m-d H:i:s'
return substr($record['timestamp'], 0, 10) === $currentDate;
});
return $todaysAttendance;
}
Following this method you can get today's records.