|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-11-18 07:33 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 19:00:01 2025 UTC |
<?php $mysql_date= '2000-01-01'; list($year, $month, $day) = explode('-', $mysql_date); $timestamp = mktime(0,0,0,$month,$day,$year); print 'mysql date:'.$mysql_date.'<br />'; print 'timestamp: '.$timestamp.'<br /><br />'; print 'strftime: '.strftime('%G', $timestamp).'<br />'; print 'date: '.date('Y', $timestamp); ?> prints: mysql date:2000-01-01 timestamp: 946681200 strftime: 1999 <------- WRONG! date: 2000