Convert in IST time in normal date time format in ssis

K Lokesh 21 Reputation points
2021-04-06T17:44:00.623+00:00

Hi friends
I was processing the data from Excel source to SQL server destination
I'm facing some problem in data in source it was come like "2 mar 2015 2:55:55 PM IST" but i need date time like this 2015-03-02 14:55:55 any one can help me please

SQL Server Integration Services
0 comments No comments
{count} votes

Answer accepted by question author
  1. Monalv-MSFT 5,926 Reputation points
    2021-04-07T03:29:28.74+00:00

    Hi @K Lokesh ,

    We can use Derived Column Transformation in SSIS Data Flow Task to get the result.

    Please refer to the following expression and pictures:

    (DT_DBTIMESTAMP)((DT_WSTR,10)TOKEN(Date," ",3) + "-" + (DT_WSTR,10)(TOKEN(Date," ",2) == "jan" ? 1 : (TOKEN(Date," ",2) == "feb" ? 2 : (TOKEN(Date," ",2) == "mar" ? 3 : (TOKEN(Date," ",2) == "apr" ? 4 : (TOKEN(Date," ",2) == "may" ? 5 : (TOKEN(Date," ",2) == "jun" ? 6 : (TOKEN(Date," ",2) == "jul" ? 7 : (TOKEN(Date," ",2) == "aug" ? 8 : (TOKEN(Date," ",2) == "sep" ? 9 : (TOKEN(Date," ",2) == "oct" ? 10 : (TOKEN(Date," ",2) == "nov" ? 11 : 12))))))))))) + "-" + (DT_WSTR,10)TOKEN(Date," ",1) + " " + (DT_WSTR,10)TOKEN(Date," ",4) + " " + (DT_WSTR,10)TOKEN(Date," ",5))  
    

    85019-df-output.png
    85020-derivedcolumntransformation.png

    Best regards,
    Mona

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. K Lokesh 21 Reputation points
    2021-04-07T06:02:14.903+00:00

    Hi Mona thanks for your answer thanks you so much 🥰🥰🥰


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.