Importing a date

Closed

Import WP Pro Updated 4 weeks ago 2 Replies

Ioan asked 1 month ago on December 9, 2024 at 4:50 pm

Good afternoon,

I’m trying to import a date:

{/PublishingDetail/PublishingDate/Date} 00:00:00

..but the format of my file is

YYYYMMDD

which gives

20220121 00:00:00

as the import (not the YYYY-MM-DD  format that is required). Is there an easy way of inseting the hyphens?

is there something like {strleft(/PublishingDetail/PublishingDate/Date,4)}

that would give me the year??

 

Thanks for any help,

 

Ioan

 

 

J

James replied Support Agent

1 month ago on December 9, 2024 at 10:48 pm

Hi loan,

You should be able to use the example of modifying dates: https://www.importwp.com/docs/modifying-dates-using-custom-methods/ , for example you would add that function to your website, and use it like so:

[iwpe01_format_date("{/PublishingDetail/PublishingDate/Date} 00:00:00", "Y-m-d H:i:s")]

this would convert the date to:

2022-01-21 00:00:00

Hope this makes sense

James

J

James replied Support Agent

4 weeks ago on December 20, 2024 at 4:19 pm

Hello Ioan

This ticket is being marked as closed due to inactivity.

If this is not the case, please reply to this ticket to re-open it.

James