How can I convert the date in the format "2013-03-15 05:14:51.327" to "2013-03-15 05:14" , i.e. delete seconds and milliseconds. I do not think that there is a way in the work of the robot. Please let me know if anyone has a solution for this in python.
"2013-03-15 05:14:51.327"
"2013-03-15 05:14"
Try it (thanks Blender!)
>>> date = "2013-03-15 05:14:51.327" >>> newdate = date.rpartition(':')[0] >>> print newdate 2013-03-15 05:14
In Robotframework, the easiest way would be to use a Split String From Right user from the String library library:
Split String From Right
${datestring}= Set Variable 2019-03-15 05:14:51.327 ${parts}= Split String From Right ${datestring} : max_split=1 # parts is a list of two elements - everything before the last ":", and everything after it # take the 1st element, it is what we're after ${no seconds}= Get From List ${parts} 0 Log ${no senods} # 2019-03-15 05:14
Source: https://habr.com/ru/post/1469456/More articles:Key capture without window focusing - c #Using if condition to compare variable values ββin WiX - windows-installerHow to remove gaps between tables and tr - htmlElement location Apache Santuario - javahttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1469455/map-query-results-to-property&usg=ALkJrhi0MNGzK44fR8iDIX9_e3YkH4RcPAcreating client libraries for Spring Data Services - spring-data-restSpecify a NULL pointer in C - cData Identifier in C ++ Class - c ++How to implement a fixed percentage survey using ScheduledExecutorService? - javaCan I change the background color on tall charts? - highchartsAll Articles