0

I have a date feild in my data and when I add it to an info window, it shows in zulu time (2017-11-06T00:00:00.000). Is there a way to format the cartoCSS and HTML so that only the date, and not the time, shows?

2

Unfortunately, it is not possible to format the date within the inforwindow code.

You would need to create a new filed in your dataset and populated it by inserting the dates in the format that you want as text. Then, you would need to add that new formatted field in the infowindow code to display it without the timestamp.

In order to transform the date format to text and format the output date, you would need to use the to_char() method which is defined in this section of the postgresql documentation. Where you can find also the different options to format your date fileds as text.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.