Definition :
In php gmstrftime() Function is inbuilt function.PHP gmstrftime() function is used to format a GMT/UTC time/date according to the local settings. It is similar to the strftime() function except that the time returned by the gmstrftime() function is Greenwich Mean Time (GMT). It accepts two parameters $format and $timezone. It returns a string formatted according to the format specified using the given timestamp value.
gmstrftime(format, timestamp)
Parameter | Description |
---|---|
format | Required. Specifies how to return the result:
|
timestamp | Optional. Specifies a Unix timestamp that represents the date and/or time to be formatted. Default is the current local time (time()) |
Given below example how to Format GMT/UTC date and time according to locale settings:
Output : 10 June 2020, 20:43:22 GMT
04 January, 2022. Tuesday. 05:37:51 GMT