Methods
date->getTime()
Retrieve the numeric timestamp in milliseconds since the Unix epoch.
The getTime method returns the number of milliseconds elapsed since the Unix epoch of January 1, 1970 UTC. This integer value matches the return value of standard epoch timestamps and allows direct numerical comparison between date instances.
Import
use NepaliDateLibrary\NepaliDate;Signature
public function getTime(): int;Parameters
- None.
Return Value
- Type:
int - Description: Milliseconds elapsed since January 1, 1970 00:00:00 UTC.
Example
use NepaliDateLibrary\NepaliDate;
$d1 = new NepaliDate('2081-01-01');
$d2 = new NepaliDate('2081-01-02');
var_dump($d1->getTime() < $d2->getTime()); // trueRelated
date->getEnglishDate(): Retrieve PHP DateTimeImmutable object.date->diff(): Calculate duration differences.
Advertisement
date->getMilliseconds()
Retrieve the millisecond component from zero to nine hundred ninety nine.
date->getEnglishDate()
Retrieve the equivalent Gregorian date as a native JavaScript Date object.