- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我有日期 2016-02-17
,我使用的是 DATE_FORMAT('2016-02-17', '%M, %D %Y')
和像这样显示'february, 17th 2016'
,但我想显示february, 17th 2016
,也就是word中的17th
,请帮忙我
最佳答案
你可以尝试这样的事情:
SELECT
CONCAT(
MONTHNAME(NOW()),
',',
SUBSTRING_INDEX(
SUBSTRING_INDEX('First Second Third Fourth Fifth Sixth Seventh Eighth Ninth Tenth 11th 12th 13th 14th 15th 16th 17th 18th 19th 20th 21st 22nd 23rd 24th 25th 26th 27th 28th 29th 30th 31st', ' ' ,DAY(NOW())),
' ',
- 1
),
' ',
YEAR (NOW())
);
注意:将 NOW()
替换为您的日期字段,并根据需要更新 SUBSTRING_INDEX('First Second....
。
演示:
SET @sampleDate := '2016-02-17';
SELECT
CONCAT(
MONTHNAME(@sampleDate),
', ',
SUBSTRING_INDEX(
SUBSTRING_INDEX('First Second Third Fourth Fifth Sixth Seventh Eighth Ninth Tenth 11th 12th 13th 14th 15th 16th 17th 18th 19th 20th 21st 22nd 23rd 24th 25th 26th 27th 28th 29th 30th 31st', ' ' ,DAY(@sampleDate)),
' ',
- 1
),
' ',
YEAR (@sampleDate)
);
关于mysql - 如何使用mysql以 "February, Seventeenth 2016"之类的字样显示日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39092761/
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 4 年前。 Improve this ques
我有日期 2016-02-17,我使用的是 DATE_FORMAT('2016-02-17', '%M, %D %Y') 和像这样显示'february, 17th 2016',但我想显示februa
我正在尝试将像这样的 mm/dd 格式的日期变成月份和日期的名称,就像它出现在 8/15 中一样,我希望它显示为 August, 15 public void printAlphabetical()
我如何在 MySQL 中订购日期值类似于“2014 年 2 月 28 日 06:21”的列? 最佳答案 使用STR_TO_DATE()先将其转换为日期,然后按日期排序: SELECT STR_TO_D
我正在用 mvc 3 + c# 做一个网站我可以知道什么方法可以让我实现标题中的技术吗?当用户输入 1, 2 ~ 12 然后无需刷新浏览器或任何其他操作,当指针 Tab 离开时,文本框中的值将自动淡入
如何在 Java 中执行此转换? 目前,我在做: public static String formatDate(String strDateToFormat) { try {
我尝试在Java中获取开始和结束日期,我在JCombobox中列出了从一月到十二月的月份列表,并在JCombobox中显示了年份。 首先,我已将 String 月份转换为月份数字并使用以下代码: if
document.getElementById("trigger_filters_created_at_from").disabled = false; Calendar.setup
我正在研究计算假期的 PHP 函数: function holidays($country = 1, $timespan_start = 0, $timespan_end = 0) 假期以数组中的时间
为什么某些 linux shell 的日期时间是 Tue Feb 24 13:03:40 SGT 2009 为什么有些是 Tuesday, February 24, 2009 1:03:41 PM S
我是一名优秀的程序员,十分优秀!