是否可以在Robotframework中将Local设置为Convert Date?
${today}= Get Time
${today_s}= Convert Date ${today} result_format=%A %d %B
4月4日星期四
但我需要
狂欢节04艾薇儿
编辑解决方法:
*** Settings ***
Library SeleniumLibrary
Library Collections
*** Variables ***
&{day_of_week_collections} Monday=Lundi Thursday=Mardi Wednesday=Mercredi Thursday=Jeudi Friday=Vendredi Saturday=Samedi Sunday=Dimanche
&{month_collections} January=Janvier February=Février March=Mars April=Avril May=Mai June=Juin July=Juillet August=Août September=Septembre October=Octobre November=Novembre December=Décembre
${day_of_week}= Convert Date ${next_week} result_format=%A
${day_of_week_fr}= Get From Dictionary ${day_of_week_collections} ${day_of_week}
答案 0 :(得分:3)
我能够使用python中的locale库获得法语结果:
Evaluate locale.setlocale(locale.LC_ALL, 'french') locale
${today}= Get Time
${today_s}= Convert Date ${today} result_format=%A %d %B
如果要使用第一个大写字母,请添加以下内容:
${today_s}= Evaluate """${today_s}""".title()