cancel
Showing results for 
Search instead for 
Did you mean: 

how to change data type from time to string from a table by using python operator in data intelligen

Subhendu2
Newcomer
0 Kudos
104

Hello Team,

Please guide me how to change data type from time to string from a table by using python operator in sap  data intelligence.

 

BR,

Subhendu

View Entire Topic
Simon_Ye
Product and Topic Expert
Product and Topic Expert

Suppose you have a datetime column "UPDATED_ON", you can use the function "strftime" to convert it to a string with a specific format:

1. import the "datetime" class from "datetime" module

     from datetime import datetime

2. use "strftime" to convert it to a string

datetime.strftime("UPDATED_ON", '%Y-%m-%d %H:%M:%S')

you can find more details from the link below:

8.1. datetime — Basic date and time types — Python 3.5.9 documentation