Link to home
Start Free TrialLog in
Avatar of swaggrK
swaggrK

asked on

Need to add the Time to a Date string

I have a SSIS package script that saves the files using the following string. I need to add time to this string.

        If Len(DatePart(DateInterval.Month, (DateTime.Now))) = 1 Then
            strMonth = "0" & DatePart(DateInterval.Month, (DateTime.Now))
        Else
            strMonth = CStr(DatePart(DateInterval.Month, (DateTime.Now)))
        End If
        If Len(DatePart(DateInterval.Day, (DateTime.Now))) = 1 Then
            strDay = "0" & DatePart(DateInterval.Day, (DateTime.Now))
        Else
            strDay = CStr(DatePart(DateInterval.Day, (DateTime.Now)))
        End If
        strYear = CStr(DatePart(DateInterval.Year, (DateTime.Now)))
        strDate = strMonth & "-" & strDay & "-" & strYear


        location = "\\NSH-MED-SCRIPT\NPR$\TPC\"
        newLocation = "\Archive\" + strDate + "\"

Open in new window


Currently, it looks like this: 5-9-2016
But, I need the time to be added to the end of the date.
ASKER CERTIFIED SOLUTION
Avatar of Mlanda T
Mlanda T
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial