Skip to main content

Date format

More
11 years 1 month ago #2081 by nikos13
Date format was created by nikos13
Hello Bram and hello community!
The import of my feed is perfect except one think. The date format is like 2013-02-09 03:43:00
.I would like to change it to d-m-Y but I am alittle confused. What should I import in my callback?

Thank you for your time once more.

Please Log in to join the conversation.

More
11 years 1 month ago #2082 by redactie
Replied by redactie on topic Re: Date format
Hi,


what kind of timestap is this? From the feed or is it the addate field?

Please Log in to join the conversation.

More
11 years 1 month ago #2083 by nikos13
Replied by nikos13 on topic Re: Date format
Good morning Bram,

The xml feed has this format. So the import is the same. I hope I helped Bram...

Please Log in to join the conversation.

More
11 years 1 month ago #2084 by redactie
Replied by redactie on topic Re: Date format
In a callback you can strip it like
Code:
function strip_cb(&$item) { generic_cb($item); #date is assigned to Select8 list($item['menu_8'],$trash)=explode(' ',$item['menu_8']); }

or if you insist on reverting the order:
Code:
if (preg_match('#([0-9]{4})-([0-9]{2})-([0-9]{2})#',$item['menu_8'],$m)) { $item['menu_8'=$m[3].'-'.$m[2].'-'.$m[1]; }

Please Log in to join the conversation.

More
11 years 1 month ago #2085 by nikos13
Replied by nikos13 on topic Re: Date format
Thank you very much for your great support Bram. I'll give a try and I'll let you know for the result.

Have a good day and thank you for your time.

Please Log in to join the conversation.

More
11 years 1 month ago #2089 by nikos13
Replied by nikos13 on topic Re: Date format
Hello Bram! After your grate code now I have [valid_from] => 13-02-2013, and [menu_4] => 13-02-2013 so I think its good till now. I have also done in "Add to description" List1 assigned to valid_from but on the right side in "Example Filtered feed items" when i do the fetch I have wrong description again like that

Mpla Mpla Mpla................Mpla Mpla

2013-02-13 18:12:01


What do I do wrong?

Thank you very much for your time and good morning!

Please Log in to join the conversation.

Time to create page: 0.464 seconds