Date Format

Priya123
Tera Contributor

I have a Date in Excel in Date format. the target table has Date /Time format. i tried to append 00:00:00 thro transform script. but its not working as expected. Any better ways to achieve this

9 REPLIES 9

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Priya123 ,

 

Did u try to load it as it it without appending the time. Did it throw any error?

 

Thanks,

Danish

Alka_Chaudhary
Mega Sage
Mega Sage

Hello @Priya123 ,

 

Do not write any script to append time (00:00:00) in date, it will be added OOB to date/time field.

 

If this response clears up your doubt, kindly flag it as both helpful and correct.

Thanks,

Alka

But business requirement is to Add 06:00:00 to the dates that we import to the Target.. Any leads ?

 

Tai Vu
Kilo Patron
Kilo Patron

Hi @Priya123 ,

Regarding the the time part as "00:00:00" => Make sure the date in correct format and go ahead to load the date.

If you'd like to have the time part as "06:00:00" => Just do a simple combine 2 strings between date and time.

Sample below.

TaiVu_0-1698129925599.png

answer = (function transformEntry(source) {

	var date_time = source.u_resolved + ' 06:00:00';
	return date_time;
	
})(source);

 

Let me know if it works for you

 

Cheers,

Tai Vu