Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
|
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 19th, 2007, 03:06 AM
Registered User
 
Join Date: Jul 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Timestamp display problem

Timestamp showing differently on the local system and on the live system.

On the local it is showing as 2007-06-06 13:14:56 but on the live
it is showing as 20070606131456.

Gives no results when i want to select a record where timestamp is like %06%.

Is there any solution to this problem.

All i need is to get the same timestamp value that is displaying on local system but on live system as it is.

plz help me out here.

thanks in advance
 
Old August 9th, 2007, 12:20 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

NareshPHP,
This is how I understand your problem.
The 2007-06-06 13:14:56 is a datetime datatype with MySQL
and the 20070606131456 is a MySQL UNIX timestamp and PHP UNIX timestamp as well.
If you want to filter this in your sql query
for the day 6 of the month or 6th month/ June.
For example:
SELECT * FROM TABLENAME
WHER DATE_FORMAT(FIELDNAME, %m) = '06';

or
SELECT * FROM TABLENAME
WHER DATE_FORMAT(FIELDNAME, %d) = '06';




Hope this helps,
John






Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeStamp nay_ctg BOOK: Beginning Cryptography with Java 1 August 7th, 2008 07:37 PM
Timestamp Problem hernann Java Databases 5 September 26th, 2007 07:51 AM
mysql timestamp to php display lbunnell PHP Databases 2 January 20th, 2005 05:55 PM
timestamp isheikh BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 November 18th, 2004 06:23 PM
Timestamp and sql nevada city J2EE 3 June 24th, 2003 11:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.