The gmstrftime() formats a GMT/UTC time or date according to local settings. This function is similar to strftime () except in returning Greenwich Mean Time (GMT). For example: when run in Eastern Standard Time (GMT -0500), the first line below prints "Dec 31 1999 20:00:00", while the second prints "Jan 01 2000 01:00:00".
Description of gmstrftime() Function PHP
string gmstrftime ( string $format [, int $timestamp= time() ] )
Parameters of PHP gmstrftime() Function
format - required. Specifies how to return the results.
timestamp - This integer parameter is optional. It specifies the date or time to be formatted. If no timestamp is specified, it uses the current GMT time.
echo(strftime("%b %d %Y %X", mktime(12,30,00,01,01,09))."<br />");
echo(gmstrftime("%b %d %Y %X", mktime(12,30,00,01,01,09))."<br />");
//Print the current date, time, and time zone.
echo(gmstrftime("It is %a on %b %d, %Y, %X time zone: %Z",time()));
The output of the code above could be:
Jan 01 2009 12:00:00
Dec 31 2008 19:00:00
It is Fri on Aug 28, 2009, 15:55:40 time zone: Eastern Standard Time
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.