How to set date format for the web application date fields

I have a date as an input in the excel as “21/12/2018”, i wanted to input this field into my web application (which has date picker) in the format “21/12/18”. how to achieve this?

Hi,

As pre-requisite:
Create two arguments
a) arg1 (Argument Type : DateTime)
b) arg3 ( Argument Type : Array Of String)
Assuming your string value is stored in afg 2 = 21/12/2018

Now follow these steps:

  1. Add a assign block and assign
    arg1 = Date.ParseExact(arg2,“dd/MM/yyyy”,
    System.Globalization.DateTimeFormatInfo.InvariantInfo)

  2. Add a assign block and assign
    arg3 = arg1.ToString.Split(" ".ToCharArray())

  3. You will get 21/12/18 as arg3(0) which you can write line and proceed further in your use case.

1 Like