Skip to main content

Date format

More
11 years 1 month ago #2092 by robidos
Replied by robidos on topic Re: Date format
try this one, you can choose the format, go to php.net/date for info
Code:
## demo date change 'menu_x' to your liking # callback script is the funtion below # this way you can juse nldatum for more callbacks (on the same menu_x) # no copyrights, used source: php.net/date & joomla.org & affiliatefeeds.nl function nldatum(&$item) { generic_cb($item); $date = date_create($item['menu_2']); $item['menu_2']=date_format($date, 'd-m-Y'); } ### callback # this way you can add more functions like above function kortinga_cb(&$item) { nldatum($item); //add more todo functions } ##########################

Please Log in to join the conversation.

More
11 years 1 month ago #2093 by redactie
Replied by redactie on topic Re: Date format
Thee date solution of robidos is correct and ake robust compared to the explode and strip solution I provided. However the problem is not in the conversion.

The 'list x' fields are used as-is from the raw data and collected in the generic_cb. So whatever you do after the generic_cb will not affect the list fields.

Solution is to convert the date before the generic_cb and use the raw field names.

Code:
function strip_cb(&$item) { list($item['valid_from'],$trash)=explode(' ',$item['valid_from']); generic_cb($item); }


Disadvantage is that you will need a cusotm parser for each feed with a different date-field-name

Please Log in to join the conversation.

More
11 years 1 month ago #2095 by nikos13
Replied by nikos13 on topic Re: Date format
First of all I would like to thank you both of you for your time. I will have access on my pc on Monday so I will inform you about the result. I have a positive feeling!

Thank you again and keep up the good work.

Please Log in to join the conversation.

More
11 years 1 month ago #2117 by nikos13
Replied by nikos13 on topic Re: Date format
Hello to the forum! Bram was right!!! I would like to thank you Bram and robidos for your time...

Keep up the good work and thank you again!

Please Log in to join the conversation.

Time to create page: 0.383 seconds