当前位置:网站首页>Usage of formatdatetime
Usage of formatdatetime
2022-07-23 19:35:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
FormatDateTime Usage of Statement : function FormatDateTime(const Format: string; DateTime: TDateTime): string; overload; Of course and Format Same, there is another kind , But here we only introduce the first commonly used Format Parameter is a formatted string .DateTime Is the time type . The return value is a formatted character string Point of view Format Instruction characters in parameters c Display time in short time format , That is, it is all the representation of numbers FormatdateTime(‘c’,now); Output is :2004-8-7 9:55:40 d Corresponds to the date in the time , If the date is one digit, one digit will be displayed , Two digits show two FormatdateTime(‘d’,now); The output may be 1~31 dd and d It means the same thing , But it is always displayed in two digits FormatdateTime(‘dd’,now); The output may be 01~31 ddd It shows the day of the week FormatdateTime(‘ddd’,now); Output is : Saturday dddd and ddd It shows the same . But the above two may be different in other countries . ddddd Display year, month and day in short time format FormatdateTime(‘ddddd’,now); Output is :2004-8-7 dddddd Display year, month, and day in a long format FormatdateTime(‘dddddd’,now); Output is :2004 year 8 month 7 Japan e/ee/eee/eeee Display the year in corresponding digits FormatdateTime(‘ee’,now); Output is :04 ( Express 04 year ) m/mm/mmm/mmmm Represents the month FormatdateTime(‘m’,now); Output is :8 FormatdateTime(‘mm’,now); Output is 08 FormatdateTime(‘mmm’,now); Output is August FormatdateTime(‘mmmm’,now); Output is August and ddd/dddd equally , It may be different in other countries yy/yyyy Indicate year FormatdateTime(‘yy’,now); Output is 04 FormatdateTime(‘yyyy’,now); Output is 2004 h/hh,n/nn,s/ss,z/zzz Hours, respectively , branch , second , millisecond t Display time in short time format FormatdateTime(‘t’,now); Output is 10:17 tt Display time in long format FormatdateTime(‘tt’,now); Output is 10:18:46 ampm Show morning or afternoon in a long format FormatdateTime(‘ttampm’,now); Output is :10:22:57 In the morning About that , If you want to in Format Add ordinary string , You can use double quotation marks to separate those Specific characters , In this way, if the ordinary string contains special characters, it will not be displayed as Time format : FormatdateTime(‘”today is” c’,now); Output is :today is 2004-8-7 10:26:58 You can also add ”-“ or ”/” To separate the dates : FormatdateTime(‘”today is” yy-mm-dd’,now); FormatdateTime(‘”today is” yy/mm/dd’,now); Output is : today is 04-08-07 It can also be used. ”:” To separate the time FormatdateTime(‘”today is” hh:nn:ss’,now); Output is :today is 10:32:23
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/126804.html Link to the original text :https://javaforall.cn
边栏推荐
- 数据链路层 -------- 以太网 和 ARP
- R语言使用dwilcox函数生成Wilcoxon秩和统计分布密度函数数据、使用plot函数可视化Wilcoxon秩和统计分布密度函数数据
- R语言data.table包进行数据分组聚合统计变换(Aggregating transforms)、计算dataframe数据的分组最小值(min)
- 在Hyper-V中手动将.avhd合并到.vhd
- C语言小项目 -- 通讯录(静态版+动态版+文件版)
- Understand chisel language. 21. Chisel sequential circuit (I) -- detailed explanation of chisel register
- 【leetcode天梯】链表 · 203 移除链表元素
- 将本地镜像发布到阿里云仓库
- R语言ggpubr包的ggarrange函数多幅图像组合起来、annotate_figure组合图像添加注释、注解、标注信息、使用top参数在可视化图像顶部添加注解信息(自定义字体颜色、大小、样式)
- PC性能监测工具,软件测试人员不可或缺的好帮手
猜你喜欢

MySQL 啥时候用表锁,啥时候用行锁?

《自适应机器人交互白皮书》

As a background developer, you must know two kinds of filters
![二叉树高度 [log2n]+1与log2(n+1)是否相等](/img/64/381376190218d5b2cdfd8b1197e8f6.png)
二叉树高度 [log2n]+1与log2(n+1)是否相等

Ros2 self study notes: rviz visualization tool

Tuple error caused by different regularization

PowerCLi 将虚拟机从Host01主机移动到Host02主机

How can zero foundation self-study software testing? Ten year test Laoniao's strongest software test learning Roadmap

Publish the local image to Alibaba cloud warehouse

PowerCLi 管理VMware vCenter 一键批量部署OVA
随机推荐
[machine learning] Wu Enda: lifelong learning
Technical scheme of face recognition system
将本地镜像发布到阿里云仓库
Type-C Bluetooth speaker single C-Port rechargeable OTG solution
ES6其他语法及扩展语法总结
PowerCLi 将虚拟机从Host01主机移动到Host02主机
Labyrinth DP integration
某些题目对应的智慧数据总结
Todo fix bug tag feature and other configurations
树学习总结
离线数据、实时数据是什么
在Hyper-V中手动将.avhd合并到.vhd
PC性能监测工具,软件测试人员不可或缺的好帮手
R语言检验样本是否符合正态性(检验样本是否来自一个正态分布总体):使用nortest包的sf.test函数检验样本是否符合正态分布(normality test)
FPGA flash reading and writing based on SPI
虹科干货 | 教您如何解析MODBUS中的浮点型数据
C language small project - address book (static version + dynamic version + file version)
As a background developer, you must know two kinds of filters
A preliminary study of the relationship between combinatorial mathematics and DP, and the derivation of resettable combinatorial formulas
Industry analysis | logistics intercom