显示日期格式的几个函数

函数|显示

'月份转换到中文
Function MonthToCH(TheMonth)
Dim mm
mm=split("一,二,三,四,五,六,七,八,九,十,十一,十二",",")
If IsNumeric(TheMonth) Then
MonthToCH = mm(TheMonth-1) & "月份"
Else
MonthToCH = " 月份"
End If
End Function

'月份转换到长英文
Function MonthToLongEN(TheMonth)
Dim mm
mm=split("January,February,March,April,May,June,July,August,September,October,November,December",",")
If IsNumeric(TheMonth) Then
MonthToLongEN = mm(TheMonth-1)
Else
MonthToLongEN = " "
End If
End Function

'月份转换到短英文
Function MonthToShortEN(TheMonth)
Dim mm
mm=split("Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",",")
If IsNumeric(TheMonth) Then
MonthToShortEN = mm(TheMonth-1)
Else
MonthToShortEN = " "
End If
End Function

时间: 2024-08-31 20:03:20

显示日期格式的几个函数的相关文章

日常收集整理oracle trunc 函数处理日期格式(很实用)_oracle

本文给大家分享的oracle trunc 函数处理日期格式的相关知识,非常具有参考价值,具体请看下文说明吧. 复制代码 代码如下: select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;  --显示当前时间 2011-12-29 16:24:34 复制代码 代码如下: select trunc(sysdate,'year') from dual; --截取到年(本年的第一天) 2011-1-1 复制代码 代码如下: select tr

WordPress常用的时间日期格式函数使用方法

在使用WordPress过程中,经常需要对WordPress的时间日期进行格式化,在PHP中格式或日期的函数是date(),但在WordPress中使用the_time()函数来格式化WordPress时间日期,说到底他们的用法基本上都差不多的,不过the_time()是直接输出,而date()函数是返回时间字符串. 参数说明 参数 参数描述 输出时间格式 d 日期 06 j 日期 6 D 星期 一 F 月份 一月 g 小时 6 G 小时 06 h 分钟 6 H 分钟 06 a 上下午 am/p

SQL农历转换函数(显示中文格式,加入润月的显示)

sql农历转换函数(显示中文格式,加入润月的显示) 创建农历日期函数  if object_id('fn_getlunar') is not null     drop function fn_getlunar go create function dbo.fn_getlunar(@solarday datetime)      returns nvarchar(30)    as      begin        declare @soldata int        declare @of

date-用两位数的格式显示日期

问题描述 用两位数的格式显示日期 我想以两位数的格式显示日期,我希望它是这样的:当月或日是一个单一的数字时,4会显示为04.如何实现呢? Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); int day = c.get(Calendar.DAY_OF_MONTH); int month = c.get(Calendar.MONTH); if (month % 10 == 0) { Place = 0 + m

浅析GridView中显示时间日期格式的问题_实用技巧

以下都是GridView基本常用的日期,时间格式 形式 语法 结果 注释 数字 {0:N2} 12.36   数字 {0:N0} 13   货币 {0:c2} $12.36   货币 {0:c4} $12.3656   货币 "¥{0:N2}" ¥12.36   科学计数法 {0:E3} 1.23E+001   百分数 {0:P} 12.25% P and p present the same. 日期 {0:D} 2006年11月25日   日期 {0:d} 2006-11-25  

SQLserver中用convert函数转换日期格式的方法_MsSql

SQL Server中文版的默认的日期字段datetime格式是yyyy-mm-dd Thh:mm:ss.mmm 例如: select getdate() 整理了一下SQL Server里面可能经常会用到的日期格式转换方法: 举例如下: select CONVERT(varchar, getdate(), 120 ) 2004-09-12 11:06:08 select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-','

如何将<td width="13%"><%# Eval("dPubDate")%></td>此种情况下的日期格式显示为: 2008-04-20

问题描述 如何将<tdwidth="13%"><%#Eval("dPubDate")%></td>此种情况下的日期格式显示为: 2008-04-20 解决方案 解决方案二:<%#((DateTime)Eval("dPubDate")).ToString("yyyy-MM-dd")%>解决方案三:引用1楼luq885的回复: <%#((DateTime)Eval("

vba-用bva让一个单元格显示另一个单元格的修改日期,且能决定日期显示的格式

问题描述 用bva让一个单元格显示另一个单元格的修改日期,且能决定日期显示的格式 Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count = 1 Then If Target.Column = 4 Then Cells(Target.Row, 6) = Now End If End If End Sub 这是我在网上收的,日期的格式太详细,我想只显示月.日就可以了.右键单元格,设置单元格格式不行,能否在vba中就把日

c#如何修改计算机时间日期和格式?利用WindowAPI函数可以做到

c#利用WindowAPI函数修改计算机日期时间和格式,代码片段如下,有需要的朋友拿去吧.  代码如下 复制代码 Public Class SetComputerDateTime { [DllImport("kernel32.dll", EntryPoint = "GetSystemDefaultLCID")] public static extern int GetSystemDefaultLCID(); [DllImport("kernel32.dll