PHP Classes

File: vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Download Installed Plugin   vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml   Download  
File: vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Download Installed Plugin
Download a WordPress plugin as a ZIP archive
Author: By
Last change:
Date: 2 days ago
Size: 1,262 bytes
 

Contents

Class file image Download
<?xml version="1.0"?> <documentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd" title="Current Time Timestamp" > <standard> <![CDATA[ Don't use current_time() to get a timestamp as it doesn't produce a Unix (UTC) timestamp, but a "WordPress timestamp", i.e. a Unix timestamp with current timezone offset. ]]> </standard> <code_comparison> <code title="Valid: using time() to get a Unix (UTC) timestamp."> <![CDATA[ $timestamp = <em>time()</em>; ]]> </code> <code title="Invalid: using current_time() to get a Unix (UTC) timestamp."> <![CDATA[ $timestamp = <em>current_time( 'timestamp', true )</em>; ]]> </code> </code_comparison> <code_comparison> <code title="Valid: using current_time() with a non-timestamp format."> <![CDATA[ $timestamp = current_time( <em>'Y-m-d'</em> ); ]]> </code> <code title="Invalid: using current_time() to get a timezone corrected timestamp."> <![CDATA[ $timestamp = <em>current_time( 'U', false )</em>; ]]> </code> </code_comparison> </documentation>