vc下的时间格式化

简介: vc下的时间格式化
formatting   codes   for   strftime   are   listed   below:    
  %a    
  Abbreviated   weekday   name    
  %A    
  Full   weekday   name    
  %b    
  Abbreviated   month   name    
  %B    
  Full   month   name    
  %c    
  Date   and   time   representation   appropriate   for   locale    
  %d    
  Day   of   month   as   decimal   number   (01   –   31)    
  %H    
  Hour   in   24-hour   format   (00   –   23)    
  %I    
  Hour   in   12-hour   format   (01   –   12)    
  %j    
  Day   of   year   as   decimal   number   (001   –   366)    
  %m    
  Month   as   decimal   number   (01   –   12)    
  %M    
  Minute   as   decimal   number   (00   –   59)    
  %p    
  Current   locale's   A.M./P.M.   indicator   for   12-hour   clock    
  %S    
  Second   as   decimal   number   (00   –   59)    
  %U    
  Week   of   year   as   decimal   number,   with   Sunday   as   first   day   of   week   (00   –   53)    
  %w    
  Weekday   as   decimal   number   (0   –   6;   Sunday   is   0)    
  %W    
  Week   of   year   as   decimal   number,   with   Monday   as   first   day   of   week   (00   –   53)    
  %x    
  Date   representation   for   current   locale    
  %X    
  Time   representation   for   current   locale    
  %y    
  Year   without   century,   as   decimal   number   (00   –   99)    
  %Y    
  Year   with   century,   as   decimal   number    
  %z,   %Z    
  Either   the   time-zone   name   or   time   zone   abbreviation,   depending   on   registry   settings;   no   characters   if   time   zone   is   unknown    
  %%    
  Percent   sign    


例如:CString   strDate=CTime::GetCurrentTime().Format("%Y-%m-%d   %H:%M:%S");

相关文章
|
C# 图形学
Unity获取系统时间-所有显示方式 DateTime类详解
Unity获取系统时间-所有显示方式 DateTime类详解 本文提供全流程,中文翻译。助力快速理解 Unity 以及 DateTime 时间类的用法 Unity获取系统时间 DateTime 类教程详解 Unity 中我们要获取时间,只需要使用 System 命名空间下的 DateTim.
6112 0
|
3月前
|
机器学习/深度学习 索引 Python
python calendar内置日历库函数方法
python calendar内置日历库函数方法
55 2
|
3月前
|
机器学习/深度学习 Python
python自定义日历库,与对应calendar库函数功能基本一致
python自定义日历库,与对应calendar库函数功能基本一致
58 0
|
3月前
|
定位技术 数据处理 Python
Python中的`datetime`模块:深入探索日期和时间操作
在Python中,处理日期和时间是一项常见的任务。`datetime`模块提供了丰富的类和方法,使得我们可以轻松地创建、解析、操作格式化日期和时间对象。这个模块在数据处理、时间戳转换、定时任务等多个领域都有着广泛的应用。
|
3月前
MFC添加年月日时分秒控件
MFC添加年月日时分秒控件
|
Unix C语言 Python
|
Python
Python 3,一行代码处理各种时间转换,从此跟datetime,time模块说拜拜 ~ ~ 不收藏算我输!!!
Python 3,一行代码处理各种时间转换,从此跟datetime,time模块说拜拜 ~ ~ 不收藏算我输!!!
357 1
Python 3,一行代码处理各种时间转换,从此跟datetime,time模块说拜拜 ~ ~ 不收藏算我输!!!
|
iOS开发
iOS 格式化时间去掉前面的0
iOS 格式化时间去掉前面的0
205 0
Python Qt GUI设计:QCalendar日历类和QDateTimeEdit时间类(基础篇—20)
Python Qt GUI设计:QCalendar日历类和QDateTimeEdit时间类(基础篇—20)
Python Qt GUI设计:QCalendar日历类和QDateTimeEdit时间类(基础篇—20)