Basicay, your date_format works like:
select DATE_FORMAT('YY-MM-DD','%y-%b-%d') from DUAL;
Martin Gainty mgai...@hotmail.com escreveu na mensagem
news:blu142-w2137936b18ae273dbd6cb1ae...@phx.gbl...
Good Afternoon All
following the documentation available at
To: mysql@lists.mysql.com
From: j...@consultorweb.cnt.br
Subject: Re: DATE_FORMAT parameter question
Date: Fri, 9 Apr 2010 12:56:46 -0300
Basicay, your date_format works like:
select DATE_FORMAT('YY-MM-DD','%y-%b-%d') from DUAL;
Martin Gainty mgai...@hotmail.com escreveu na mensagem
If you'll excuse the shameless plug: I once created a tool to help find
the exact parameters to use for PHPs date() and MySQLs DATE_FORMAT().
Please see
http://bitbybit.dk/php/date_format/
(Yes, it looks horrible. But it works)
/ Carsten
Martin Gainty skrev:
Good Afternoon All
following
que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
Date: Fri, 9 Apr 2010 19:02:33 +0200
From: cars...@bitbybit.dk
To: mgai...@hotmail.com
CC: mysql@lists.mysql.com
Subject: Re: DATE_FORMAT parameter
If you need the date like, '2004/01/01', then shouldn't it be '%Y/%m/%d'?
You still ahve the dashes (the '-' character) in your date-format, and you
need a forward-slash (the '/' character) instead.
Here's what I ran on MySQL:
mysql select date_format(NOW(), '%Y/%m/%d');
Look in your my.ini file.
There's maybe an entry:
language=f:/mysql/share/german
Set it to your favourit language!
Bernhard
- Original Message -
From: Steve Vernon [EMAIL PROTECTED]
To: Mysql List [EMAIL PROTECTED]
Sent: Wednesday, October 22, 2003 4:47 PM
Subject: date_format
Hello Steve,
Steve Vernon wrote on 22.10.2003 16:47
I suppose I could return the month as a number, and then output the text
from that, but this seems a bit tacky!
I think that's the most reliable way, imagine you move to a new server
or install your software somewhere else . . . I
On 3 Oct 2002, at 15:33, Mark Colvin wrote:
The problem I am having is with the DATE_FORMAT. Running the above query
returns the following for the width column.
94.40 DATE_FORMAT(d1.created, '%d-%m-%Y'): NULL DATE_FORMAT(d1.amended,
'%d-%m-%Y'): 03-10-2002
Show your PHP code. How
Yes, there is .. You can use %D (note that it is capital D) instead of %e to
get what you wanna get.
See: http://www.mysql.com/doc/D/a/Date_and_time_functions.html
Gurhan
-Original Message-
From: Lee P Reilly [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 22, 2002 5:51 PM
To: MySQL
Thanks this works
the difference was the 'AS datefield'
what is this bit doing? I searched for AS (in the SELECT description in my
book) but it does not mention it; though I have seen it in examples. I like
to understand why I use the code I do...
I looked at http://www.mysql.com/ but can
- Original Message -
From: julian haffegee [EMAIL PROTECTED]
To: MySQL General List [EMAIL PROTECTED]
Sent: Monday, December 31, 2001 2:55 PM
Subject: Re: date_format
Thanks this works
the difference was the 'AS datefield'
what is this bit doing? I searched for AS (in the SELECT
#2 All I have read on the web/books suggests that this is what to do
$result = mysql_query (SELECT title, description, url, author,
date_format(datefield, %M %D %Y') FROM documents);
This just leaves out all dates.
You may want to try:
$result = mysql_query(SELECT title, description,
At 17:51 19.07.2001 +0200, you wrote:
okay, i see this output on my sco-machine:
'2001071614' '2001-07-19 14:00:00'
if i try the same with mysql-front on my win2k machine:
'2001071914' '2001-07-19 14:00:00'
Somehow your sample data doesn't look right: shouldn't it be
'2001071614'
At 09:25 19.07.2001 -0400, you wrote:
Probably due to timezone setting differences between the two
client machines.
i also thought about that, but there are 2 DAYs difference... can this be a
timezone issue ?
okay, i see this output on my sco-machine:
'2001071614' '2001-07-19 14:00:00'
if i
At 09:40 19.07.2001 -0400, you wrote:
You're correct, likely not a timezone problem.
Have you confirmed that the clocks on these machines are
synchronized? That they aren't really three days off?
yep, again and agein :)
the clocks are in sync +/- 5 secs
okay, i see this output on my
Paul Schreiber writes:
Sinisa Milivojevic wrote:
cut
Column start is of type TIME. The actual values are illustrated above in
the example.
Paul
Hi!
Then it is not a bug. As our manual clearly points out, date_format
can be used only on date and datetime column types.
Regards,
Sinisa Milivojevic wrote:
[EMAIL PROTECTED] writes:
Description:
date_format is setting times to 12:00 AM; time_format works fine
How-To-Repeat:
mysql select start,TIME_FORMAT(start, '%l:%i %p') AS start2 FROM time;
+--+--+
| start| start2 |
Hi Peter,
The collumn is a datatime... You are tight that date probably should be is a
reserved word..
I must say that I never had any troubles with it, I started using it when I
was a newbie with PHP about a year ago...
On almost all my tables I always have an auto-increment column with the
On Wednesday 17 January 2001 00:20 Cindy wrote:
OK. I went to the documentation at www.mysql.com and typed in
DATE_FORMAT in the search box, hopefully find a list of the %M's, etc
rules that may be used (I'd like December to become Dec, etc). No
dice. Randomly looking through sections that
It's (sort of) obvious what Cindy is looking for...
In slightly clearer terms, is it possible to format a selected date using
a
format string similar to that available in C's strftime() function -
where %M might stand for month name, %d might stand for day number,
etc.
regards,
P
On Wed, 17
[EMAIL PROTECTED] writes:
It's (sort of) obvious what Cindy is looking for...
In slightly clearer terms, is it possible to format a selected date using
a
format string similar to that available in C's strftime() function -
where %M might stand for month name, %d might stand for day
Hello Cindy,
I posted this in response to another date formatting question, hope it
helps.
The link should be helpful if you haven't found it already.
SELECT fields, DATE_FORMAT(datefield, '%M %d, %Y');
I just looked it up myself...It's all in the manual at:
Try the manual contents, linked from the documentation page
http://www.mysql.com/documentation/mysql/bychapter
OK. I went to the documentation at www.mysql.com and typed in
DATE_FORMAT in the search box, hopefully find a list of the %M's, etc
rules that may be used (I'd like December to
23 matches
Mail list logo