medy75
medy75

Reputation: 656

Day code in jMeter into variable

Is it possible to get code of current day in jMeter into variable? Day code I mean something like: MON or FRI or something like that. I need do get it into variable and work with it.

Upvotes: 0

Views: 503

Answers (2)

Luke
Luke

Reputation: 11

Using the jmeter time function can help here. ${__time(E,)} will return the current day in short format, i.e Mon, Tue, Wed. If you're looking for a longer format, ${__time(EEEE,)} will return the current day in long format, i.e Monday, Tuesday, Wednesday. Hope this helps.

Upvotes: 0

olyv
olyv

Reputation: 3817

I usually use BSF processors and if you used Groovy then it would look like Date.parse("yyyy-MM-dd", "2011-04-02").format("EEE"). This produces three letter code of day. E.g., today is "Tue". Then you can use toUpperCase() to make it TUE.

Upvotes: 1

Related Questions