Both DATE and TIMESTAMP types are unloaded using epochmillisecs format currently. Data is loaded back into Redshift by using COPY ... TIMEFORMAT 'epochmillisecs' here, however, this fails for DATE types as the default of DATEFORMAT 'auto', does not handle epochmillisecs, nor is there currently even an option of DATEFORMAT 'epochmillisecs' that could be used (perhaps a good Redshift enhancement). Given this, it seems to make more sense to use a common serialization format that could be used for both DATE and TIMESTAMP, like YYYY-MM-DD HH:MI:SS.SSSSSS which does work for both types even when the data contains fractional seconds using DATEFORMAT 'YYYY-MM-DD HH:MI:SS'. The default format for TIMESTAMP is YYYY-MM-DD HH:MI:SS so no TIMEFORMAT is then required. See docs.
Both DATE and TIMESTAMP types are unloaded using epochmillisecs format currently. Data is loaded back into Redshift by using
COPY ... TIMEFORMAT 'epochmillisecs'here, however, this fails for DATE types as the default ofDATEFORMAT 'auto', does not handle epochmillisecs, nor is there currently even an option ofDATEFORMAT 'epochmillisecs'that could be used (perhaps a good Redshift enhancement). Given this, it seems to make more sense to use a common serialization format that could be used for both DATE and TIMESTAMP, likeYYYY-MM-DD HH:MI:SS.SSSSSSwhich does work for both types even when the data contains fractional seconds usingDATEFORMAT 'YYYY-MM-DD HH:MI:SS'. The default format for TIMESTAMP isYYYY-MM-DD HH:MI:SSso noTIMEFORMATis then required. See docs.