This site requires JavaScript to be enabled
IE BUMPER

Product
Version
IncidentLookup using list
Language
How can we help?

Solution Suggestions

Please enter your question to get suggestions.
  Help
IE BUMPER
Categories
Boolean Operators
OR or vertical bar symbol (|)
Finds a match if either the terms exist in a document (a union using sets).
AND
Finds a match if both terms exist in a document (an intersection of sets).
NOT, minus (-), or exclamation point (!)
Excludes documents that contain the term after NOT (a difference of sets).
Wildcards
Asterisk (*)
The asterisk symbol performs a multi character wildcard search.
Percent sign (%)
The percent sign performs a single character wildcard search.
Phrases
Quotation marks (")
Use quotation marks to search for an exact phrase with multiple terms.
For examples and more information look at our Knowledge Base: Advanced Search On The Support Portal

Convert Date Format

Converting Date Format in Tosca Commander 


Situation

I want to convert a date format in Tosca Commander.

 

Solution

For this example we will take the date 2015-28-02 and convert it to the format dd/MM/yyyy

 

Step 1: Buffer your original date in Tosca. In this example we will buffer the date 2015-28-02 and we will name the buffer FirstDateBuffer

Step 2: In your test case add the “TBox Set Buffer” module as a teststep.

Step 3: Pick a name for the buffer for your new date. For the value enter

{DATE[{B[FirstDateBuffer]}][][dd/MM/yyyy]}

This will take the first date and convert it to the dd/MM/yyyy format. If you want to convert to a different format just replace that section with the desired format.

 

Step 4: If you run this you will probably get an error about 2015-28-02 not being recognized as a date format. To fix this, select the testcase where the conversion is taking place then select "Test configurations”. Right click and create a test configuration parameter, name it ToscaDateFormat and set the value to the format of the first date, so in our example yyyy-dd-MM

 

Reference

Link to the date and time formats: https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings

0 0

Aasiya Shaikh

Created: 2020-05-29 12:13:04 , Updates: 1, Last Update: 2020-05-29 12:15:02

Please let me know how can I convert a string "20171222" into date and then into a specific format.

0 0

Abhijeet Yadav

Created: 2020-08-27 08:18:23

Hi Aasiya,

You can keep the ToscaDate Format = yyyyMMdd and use the Date function to convert to any date format which is  required.

Thanks

Abhijeet

0 0

Kashish Kumar

Created: 2021-04-29 08:54:25

Can anyone help me with the below problem?

The date being entered in a field is in dd/MM/yyyy. I am trying to buffer the value as the requirement is to verify the date is same but it exists in yyyy-MM-dd format on the other page. I tried buffering the value using TBoxBuffer {DATE[{B[StartDate]}][][yyyy-MM-dd]} and gave "ToscaDateFormat in TCP with value as "dd/MM/yyyy"", since this is initial value. After running it I get "The value '29.04.2021' can not be interpreted as date" while entering the value but if I change the format in TCP it fails while taking the buffer with same error but date format as "dd/MM/yyyy" 

0 0

Michelle Kuijt

Created: 2021-04-30 12:17:57

I also encountered this problem. I had to buffer the value as a "string" instead of a "date", after that it worked. I hope it helps.