I read the date from Notepad and convert it into date using Dateserial function. I try to convert it into my desired format like fomat( ,"dd/mm/yy") but I am unable to do that.
[CODE=vb] Dim fs As New FileSystemObjec t
Dim ts As TextStream
Dim str As String
Dim int1 As Integer
Dim dt1 As String
Dim dt As Date
Dim date1 As Date
Dim DATE2 As Date
Set ts = fs.OpenTextFile ("c:\1.txt", ForReading, True)
str = ts.ReadLine
dt1 = Trim(Mid(str, 1, 10))
date1 = DateSerial(Year (dt1), Month(dt1), Day(dt1))
DATE2 = Format(date1, "mm/dd/yy")
Set fs = Nothing
ts.Close[/CODE]
[CODE=vb] Dim fs As New FileSystemObjec t
Dim ts As TextStream
Dim str As String
Dim int1 As Integer
Dim dt1 As String
Dim dt As Date
Dim date1 As Date
Dim DATE2 As Date
Set ts = fs.OpenTextFile ("c:\1.txt", ForReading, True)
str = ts.ReadLine
dt1 = Trim(Mid(str, 1, 10))
date1 = DateSerial(Year (dt1), Month(dt1), Day(dt1))
DATE2 = Format(date1, "mm/dd/yy")
Set fs = Nothing
ts.Close[/CODE]
Comment