RobotFramework: 获取当前时间戳

robot中先导入DateTime库

RobotFramework: 获取当前时间戳_第1张图片

 

    #获取当前时间:2019-07-31 10:46:29.940
    ${time}    Get Current Date    result_format=timestamp
    #转化为原始时间戳:1564541189.94
    ${time_stamp}    Convert Date    ${time}    epoch
    #转化为毫秒级时间戳:1564541189940
    ${time_stamp2}    evaluate    int(round(${time_stamp} * 1000))

其他时间操作:

参考:https://blog.csdn.net/r455678/article/details/52993765

 

转载于:https://www.cnblogs.com/gcgc/p/11274976.html

你可能感兴趣的:(RobotFramework: 获取当前时间戳)