robotframework - 如何在 DatetTime Library Robotframework 中将日期转换为从 Month 中丢失前导零?
问题描述
我有以下代码
${d}= Get Current Date result_format=%m/%d/%Y
log ${d}
输出是
2018 年 6 月 14 日
在我的期望中,我想要
2018 年 6 月 14 日
谢谢
解决方案
你能试一下吗
${d}= Get Current Date result_format=%#m/%d/%Y
log ${d}
在月份前面使用“#”来消除零。参考链接
请注意,这取决于平台;对于 Unix (Linux/MacOS),您需要使用连字符:
%Y/%-m/%-d
推荐阅读
- process - Process Table 和 UNIX 中的 Job Queue 是一样的吗?
- microsoft-teams - 注册 Teams 连接器时的 handleMessageError
- sql - 在后触发函数中使用new_table、old_table、原表名
- java - 将 API 请求类型映射为内部对象类型
- image - 使用 TCPDF 在框中分配全宽图像
- mysql - 减去行并使用结果创建新列
- angular - 登录重定向上的 Oidc-client identityserver 无限循环 Angular 10 应用程序
- java - ant build.xml 在 Eclipse 中工作,但不是通过命令行
- powershell - Powershell以其他用户身份运行带有参数的远程exe
- php - 部署在 aws lambda 上时的 Laravel 外观问题