Published on : August 03, 2020
Title : php.strtotime
Purpose : Parse English textual datetimes into Unix timestamps
Syntax : [php.strtotime p1=’time’ p2=’now’ o.set=’variable name’ /]
Input Parameters :
p1 : Required. Specifies a date/time string
p2 : Optional. Specifies the timestamp used as a base for the calculation of relative dates
Return Value : Returns a timestamp on success. FALSE on failure
Example 1 :
Code : [php.strtotime p1=”now” o.set=template.current_timestamp /]
Output : int(1596467008)
Description : It will convert the current date and time to timestamp
Example 2 :
Code : [php.strtotime p1=”3 October 2005 5 pm” o.set=template.specific_timestamp /]
Output : int(1128339000)
Description : It will convert the given date and time to timestamp