账号通
    

账号  

密码  

1343

查看

3

回复
主题:[求助]数字日期怎么转换成英文日期 [收藏主题] 转到:  
久睡成瘾1 当前离线

12

主题

0

广播

0

粉丝
添加关注
级别:学前班

用户积分:25 分
登录次数:2 次
注册时间:2018/3/1
最后登录:2018/3/28
久睡成瘾1 发表于:2018/3/1 18:13:18   | 只看该作者 查看该作者主题 楼主 
科汛在线商城系统(NET)
科讯cms 中的数字日期怎么转换成英文日期
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
fengdi00 当前离线

572

主题

4

广播

8

粉丝
添加关注
级别:五年级

用户积分:5225 分
登录次数:922 次
注册时间:2007/8/3
最后登录:2024/9/17
fengdi00 发表于:2018/3/1 19:30:12   | 只看该作者 查看该作者主题 沙发 
做在线知识付费 选科汛云开店
修改日期格式化代码
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
fengdi00 当前离线

572

主题

4

广播

8

粉丝
添加关注
级别:五年级

用户积分:5225 分
登录次数:922 次
注册时间:2007/8/3
最后登录:2024/9/17
fengdi00 发表于:2018/3/1 19:30:40   | 只看该作者 查看该作者主题 藤椅 
科汛在线商城系统(NET)
Public Function DateToStr(DateTime,ShowType)  

  Dim DateMonth,DateDay,DateHour,DateMinute,DateWeek,DateSecond

  Dim FullWeekday,shortWeekday,Fullmonth,Shortmonth,TimeZone1,TimeZone2

  TimeZone1="+0800"

  TimeZone2="+08:00"

  FullWeekday=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")

  shortWeekday=Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")

  Fullmonth=Array("January","February","March","April","May","June","July","August","September","October","November","December")

  Shortmonth=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")



  DateMonth=Month(DateTime)

  DateDay=Day(DateTime)

  DateHour=Hour(DateTime)

  DateMinute=Minute(DateTime)

  DateWeek=weekday(DateTime)

  DateSecond=Second(DateTime)

  If Len(DateMonth)<2 Then DateMonth="0"&DateMonth

  If Len(DateDay)<2 Then DateDay="0"&DateDay

  If Len(DateMinute)<2 Then DateMinute="0"&DateMinute

  Select Case ShowType

  Case "Y-m-d"  

   DateToStr=Year(DateTime)&"-"&DateMonth&"-"&DateDay

  Case "Y-m-d H:I A"

   Dim DateAMPM

   If DateHour>12 Then

    DateHour=DateHour-12

    DateAMPM="PM"

   Else

    DateHour=DateHour

    DateAMPM="AM"

   End If

   If Len(DateHour)<2 Then DateHour="0"&DateHour

   DateToStr=Year(DateTime)&"-"&DateMonth&"-"&DateDay&" "&DateHour&":"&DateMinute&" "&DateAMPM

  Case "Y-m-d H:I:S"

   If Len(DateHour)<2 Then DateHour="0"&DateHour

   If Len(DateSecond)<2 Then DateSecond="0"&DateSecond

   DateToStr=Year(DateTime)&"-"&DateMonth&"-"&DateDay&" "&DateHour&":"&DateMinute&":"&DateSecond

  Case "YmdHIS"

   DateSecond=Second(DateTime)

   If Len(DateHour)<2 Then DateHour="0"&DateHour

   If Len(DateSecond)<2 Then DateSecond="0"&DateSecond

   DateToStr=Year(DateTime)&DateMonth&DateDay&DateHour&DateMinute&DateSecond

  Case "ym"

   DateToStr=Right(Year(DateTime),2)&DateMonth

  Case "d"

   DateToStr=DateDay

  Case "ymd"

   DateToStr=Right(Year(DateTime),4)&DateMonth&DateDay

  Case "mdy"

   Dim DayEnd

   select Case DateDay

    Case 1

     DayEnd="st"

    Case 2

     DayEnd="nd"

    Case 3

     DayEnd="rd"

    Case Else

     DayEnd="th"

   End Select

   DateToStr=Fullmonth(DateMonth-1)&" "&DateDay&DayEnd&" "&Right(Year(DateTime),4)

  Case "w,d m y H:I:S"

   DateSecond=Second(DateTime)

   If Len(DateHour)<2 Then DateHour="0"&DateHour

   If Len(DateSecond)<2 Then DateSecond="0"&DateSecond

   DateToStr=shortWeekday(DateWeek-1)&","&DateDay&" "& Left(Fullmonth(DateMonth-1),3) &Right(Year(DateTime),4)&" "&DateHour&":"&DateMinute&":"&DateSecond&" "&TimeZone1

  Case "y-m-dTH:I:S"

   If Len(DateHour)<2 Then DateHour="0"&DateHour

   If Len(DateSecond)<2 Then DateSecond="0"&DateSecond

   DateToStr=Year(DateTime)&"-"&DateMonth&"-"&DateDay&"T"&DateHour&":"&DateMinute&":"&DateSecond&TimeZone2

  Case Else

   If Len(DateHour)<2 Then DateHour="0"&DateHour

   DateToStr=Year(DateTime)&"-"&DateMonth&"-"&DateDay&" "&DateHour&":"&DateMinute

  End Select

End Function

'使用方法

Call DateToStr("2010-5-5","st")
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
久睡成瘾1 当前离线

12

主题

0

广播

0

粉丝
添加关注
级别:学前班

用户积分:25 分
登录次数:2 次
注册时间:2018/3/1
最后登录:2018/3/28
久睡成瘾1 发表于:2018/3/2 14:05:04   | 只看该作者 查看该作者主题 板凳 
做在线知识付费 选科汛云开店
更改这个代码的 位置 和调用这个代码位置在哪 我是学java的 找到了asp的工作我是初学者 帮帮忙吧
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
<上一主题 | 下一主题 >
Powered By KesionCMS Version X1
厦门科汛软件有限公司 © 2006-2016 页面执行0.10938秒 powered by KesionCMS 9.0