ANSHUL
(MANTRI)
August 30, 2019, 7:49am
1
@loginerror @srdjan.suc any suggestion pls?
Hi have a datatable with column somedate.
the values in this column is 20190830,i want to use a regex to change date format to “dd/mm/yyy” for the entire column.
i am looping through the datatable and inside for each row:
row(“sonedate”) i get value 20190830.
Any suggestion what is the best way to convert it to 30/08/2019.
Best Regards
1 Like
AshwinS2
(Ashwin S)
August 30, 2019, 7:58am
2
Hi @ANSHUL
Instead ofconverting yyyymmdd to dd/mm/yyyy
CDate(row(“sonedate”).ToString(“dd/mm/yyyy”))
Thanks
Ashwin S
1 Like
ANSHUL
(MANTRI)
August 30, 2019, 8:11am
3
Already tried, getting this error
lakshman
(Ganta lakshman)
August 30, 2019, 8:20am
4
@ANSHUL
Try Below one:
row("sonedate") = Datetime.parseexact(row("sonedate").ToString,“yyyyMMdd”,system.globalization.cultureinfo.invariantculture).tostring(“dd/MM/yyyy”)
2 Likes
sonminator
(Le Dinh Hoang Son)
August 30, 2019, 8:25am
5
You can try this one @ANSHUL
Imports System
Dim strDate = “20190830”
Dim dateVal3 As DateTime
Dim outputStr As String
If Date.TryParseExact(strDate, “yyyyMMdd”, System.Globalization.CultureInfo.GetCultureInfo(“en-US”), System.Globalization.DateTimeStyles.None , dateVal3) Then
outputStr = dateVal3.ToString(“dd/MM/yyyy”)
Console.WriteLine(outputStr)
Else
Console.WriteLine(“‘{0}’ is not in an acceptable format.”, strDate)
End If
lakshman
(Ganta lakshman)
August 30, 2019, 8:47am
7
@ANSHUL
Use Assign activity and try above expression. It should be inside ForEach Row activity.
row(“sonedate”) = Datetime.parseexact(row(“sonedate”).ToString,“yyyyMMdd”,system.globalization.cultureinfo.invariantculture).tostring(“dd/MM/yyyy”)
5 Likes
system
(system)
Closed
September 2, 2019, 8:47am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.