OA Date Conversion to Date Value

Hi again, team.

I’m trying to retrieve a formatted date from Excel and type into a date text box. However, the script is typing in the OA value (double) instead of the actual date.
Ex:
Required value that need entered: ‘1-Dec-2019’
Actual value being entered: ‘43800’

I already tried the following and no luck:
DateTime.FromOADate(row(“FROM DATE”).ToString(“d-MMM’yyyy”)
Convert.ToDateTime(row(“FROM DATE”)).ToString(“d-MMM-yyyy”))

Been looking all over the place and nothing so far. Really looking forward hearing back from you. Thanks!

Martin

1 Like

Change the format of your excel column to text or date ? @martsantos

cheers :smiley:

Happy learning :smiley:

2 Likes

Hi
Try with this expression
DateTime.FromOADate(Convert.ToDouble(row(“yourcolumnname”).ToString)).ToString(“dd-MMM-yyyy”)

Cheers @martsantos

5 Likes

@Palaniyappan you are a genius! Thank you! Worked like a charm! :smile:

4 Likes

Cheers @martsantos

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.