Generates a SQL timestamp from the provided date/time; otherwise, defaults to now.
sqlTimestamp(string|integer|null $datetime): string
datetime (string|integer|null) : A date/time string or Unix timestamp. (default: null) ^(optional)^
null
(string) : Returns the SQL timestamp for a given date/time, or current time if datetime is null.
$fx->sqlTimestamp() = YYYY-MM-DD HH:MM:SS (current date and time) $fx->sqlTimestamp('July 29, 2015 3:45pm') = 2015-07-29 15:45:00 $fx->sqlTimestamp(1438209900) = 2015-07-29 15:45:00 $fx->sqlTimestamp('-1 week') = YYYY-MM-DD HH:MM:SS (1 week ago)
emailTimestamp | isSqlTimestamp | sqlDate | sqlTime | timestamp
Home | CoreyFX | Date and Time Processing
There was an error while loading. Please reload this page.