4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 now() displays incorrect time format
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
nareshphp
Junior WebHelper
Junior WebHelper


Joined: 19 Jul 2007
Posts: 1

PostPosted: Thu Jul 19, 2007 11:16 am (10 years, 3 months ago) Reply with QuoteBack to Top

I've inserted a record into mysql db using now() function value.

just like...

insert into TABLE_NAME(date,name,age)values(now(),'Naresh','24')

when tried to echo the date filed value on the local system,it gives me 2007-06-06 13:14:16.

But on the live system it gives me as 20070606131416.
It's weird and i can't understand what the problem.

And need to get the same format exactly as on the local system.
I need that format for my database queries.

can any one help me out here?

Thanks in advance.
OfflineView User's ProfileFind all posts by nareshphpSend Personal Message
ddemetrius456
Junior WebHelper
Junior WebHelper


Joined: 22 Oct 2009
Posts: 6

PostPosted: Wed Oct 28, 2009 3:31 am (7 years, 11 months ago) Reply with QuoteBack to Top

TABLE_NAME(date,name,age)values(date(),'Naresh','24').
This will solve your problem.
OfflineView User's ProfileFind all posts by ddemetrius456Send Personal Message
Vitopa
Junior WebHelper
Junior WebHelper


Joined: 26 Feb 2015
Posts: 12
Location: Ellicott City, Md.

PostPosted: Fri Jul 10, 2015 3:19 pm (2 years, 3 months ago) Reply with QuoteBack to Top

Hi All,



I am facing a issue in changing the date format of a column in my database. Below is my code


PHP Code:
OfflineView User's ProfileFind all posts by VitopaSend Personal MessageSend emailAOL Instant MessengerYahoo MessengerICQ Number
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.084489 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme