\Pluf_Date

کلاسی کاربردی برای کار با تاریخ

استفاده از تاریخ در سیستم‌های شبکه بسیار مرسوم است. در پیاده سازی‌های متفاوت به دسته‌ای از عملیات‌ها نیاز داریم که تاریخ را دستکاری کنند. در اینجا تمام فراخوانی‌های مورد نیاز برای کار با تاریخ آورده شده است.

Summary

Methods
Properties
Constants
gmDateToString()
gmDateToGmString()
dayCompare()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

gmDateToString()

gmDateToString(  $gmdate,   $format = '%Y-%m-%d %H:%M:%S') : string

Get a GM Date in the format YYYY-MM-DD HH:MM:SS and returns a string with the given format in the current timezone.

Parameters

$gmdate
$format

Returns

string —

Formated GMDate into the local time

gmDateToGmString()

gmDateToGmString(  $gmdate,   $format = 'c') : string

Get a GM Date in the format YYYY-MM-DD HH:MM:SS and returns a string with the given format in GMT.

Parameters

$gmdate
$format

Returns

string —

Formated GMDate into GMT

dayCompare()

dayCompare(  $date1,   $date2 = null) : integer

Day compare.

Compare if the first date is before or after the second date. Returns: 0 if the days are the same. 1 if the first date is before the second. -1 if the first date is after the second.

Parameters

$date1
$date2

Returns

integer