Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting substrings of the !today variable in Fitnesse

Tags:

fitnesse

I'm writing a Fitnesse test for a web application. One of the items to test is a drop-down box, whose value is determined by the current date, in DD/MM/YYYY format.

I'd thought that using the !today variable in the Fitnesse suite might be a useful way of setting a variable, but I've run into the problem that Fitnesse expresses the date as (for example) 11 Mar, 2011, where I need 11/03/2011. I can get the date in numberic format using the -xml modifier, but I'm still left with a pretty huge string like 2011-03-11T05:51:22.

Is there a way of getting substrings of this, and then piping those into page variables, or am I barking up entirely the wrong tree here?

Thanks!

like image 574
nihilogist Avatar asked Dec 06 '25 13:12

nihilogist


1 Answers

!today (MM/dd/yyyy) produces 09/17/2012. You can use any format codes you like. It uses the SimpleDateFormat class.

like image 148
craig Avatar answered Dec 10 '25 11:12

craig



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!