I have a data frame in Pyspark
. In this data frame I have a column which is of timestamp
data type. Now I want to add extra 2 hours for each row of the timestamp column without creating any new columns.
For Example: This is sample data
df
id testing_time test_name
1 2017-03-12 03:19:58 Raising
2 2017-03-12 03:21:30 sleeping
3 2017-03-12 03:29:40 walking
4 2017-03-12 03:31:23 talking
5 2017-03-12 04:19:47 eating
6 2017-03-12 04:33:51 working
I want to have something like below.
df1
id testing_time test_name
1 2017-03-12 05:19:58 Raising
2 2017-03-12 05:21:30 sleeping
3 2017-03-12 05:29:40 walking
4 2017-03-12 05:31:23 talking
5 2017-03-12 06:19:47 eating
6 2017-03-12 06:33:51 working
How can I do that?