Basically I want to take this type of date:
November 22, 2001, 9:23:30 p.m. EST
and automatically convert it to
2001_326:09:23:30.000
Where 326 represents what day out of 365 Nov 22 is.
Is this possible?
Basically I want to take this type of date:
November 22, 2001, 9:23:30 p.m. EST
and automatically convert it to
2001_326:09:23:30.000
Where 326 represents what day out of 365 Nov 22 is.
Is this possible?
I think that this should be relatively simple.
On second thoughts I decided to use a user defined function as this allowed my to use two arrays to simplify the process.
![]()
Function MyDate(MyStr As String) MyArray = Split(MyStr, " ", -1, 1) If MyArray(4) = "p.m." Then temp = Split(MyArray(3), ":") MyArray(4) = temp(0) + 12 & ":" & temp(1) & ":" & temp(2) End If MyDate = Left(MyArray(2), 4) & "_" & DateDiff("d", "01-01-" & Left(MyArray(2), 4), Left(MyArray(1), 2) & "/" & MyArray(0) & "/" & Left(MyArray(2), 4)) + 1 & ":" & MyArray(4) & ".000" End Function
Last edited by mehmetcik; 10-22-2014 at 03:27 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks