Update Pateint get dengan format ISO 8601_v2
This commit is contained in:
parent
a69a5719ad
commit
0810f837af
@ -344,12 +344,17 @@ class PatientModel extends Model {
|
||||
}
|
||||
|
||||
// Conversion Time to Format Y-m-d\TH:i:s\Z
|
||||
private function formatedDate($dateString) {
|
||||
// return $date->format('Y-m-d H:i');
|
||||
$dt = new \DateTime($dateString, new \DateTimeZone("UTC"));
|
||||
private function formattedDate(?string $dateString): ?string {
|
||||
try {
|
||||
if (empty($dateString)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Format jadi ISO 8601 dengan 'Z'
|
||||
return $dt->format('Y-m-d\TH:i:s\Z');
|
||||
$dt = new \DateTime($dateString, new \DateTimeZone("UTC"));
|
||||
return $dt->format('Y-m-d\TH:i:s\Z'); // ISO 8601 UTC
|
||||
} catch (\Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Conversion Time to Format j M Y
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user