Remove seconds from start date
Thanks for a great plugin!
I use Post Table Pro plugin to display a sortable table of events. This is done by a shortcode but the format of the time I receive is 08:00:00. Is it possible to remove the last “:00”. I only need the hour and minutes, not the seconds. Can I easilly set this in a function or in the control panel?
I have already asked Post Table Pro support about this, and they say that this has to go through your support it has to do with ECP-plugin.
Thank you for reaching out to us!
The time format for our plugins is the same as the one in your WordPress install, so I would recommend you to access your Dashboard and head over to Settings > General > Time Format and make sure that you have the correct time format enabled.
Thanks for your answer. I checked by general settings and they are correct, see first attachement showing my WP settings. Here both date and time is correct, without seconds time. But when I look at the table it is shows seconds (second attachment). Plugin Post Table Pro support answered:
The time is coming from the Events Calendar Pro plugin, so you will need to contact their support about this.
To me, and I’m no expert, it seems that the date and time is fetched directly from the database, not the standard WP setting. Is the format 2017-12-11 09:00:00 hos this is stored in Event Calendar?
Do you have any idea how I can get this right?
Before we proceed, could you please access your events calendar and check what is your time format in there and send us a screenshot? Do your events display the same time format as the one in your custom table?
If you access your Dashboard and head over to Events > Settings > Date Format Settings, you’ll see that only the event date format is manageable/modified by our plugin, the time format is essentially the same as the one under Settings > General > Time Format (you can check this by yourself by accessing your calendar and/or one of your events while changing the time settings from your Dashboard).
I’m not sure how you are calling/listing each one of these events in this custom table, but maybe if you change your date format under Events > Settings > Date Format Settings to something like this: “Y-m-d g:i:s A” you may achieve what you want (but please note that with this change, the time of your events will be displayed twice in your calendar and single events, because you are actually editing the date settings and not the time settings).
You will find more info about date and time format here:
I hope this helps you to get started! If you have any other questions please feel free to let me know and I’d be happy to help as best I can!
Thanks for your answer. I have tested and changed the date format to Y-m-d g:i:s A. This gives no solution to the table, see attachments. But the new time format is displayed on the event. As you mention, with this I will have time twice on single event.
It seems that the date format has nothing to do with what the table fetches. It displays the same format every time, regardless of what format I use. Maybe this has to do what is stored in the database and the table fetches the exact stored value?
Just to set expectations, the scope of our support is mostly to get our customers started on the right track and to help them in case of issues. We unfortunately do not provide complete support for customizations like this one.
The suggested date format update was just to check if it affects the way the time format is displayed in this table you created via Post Table Pro plugin. At this point I would recommend you to review the code used to generate this table. We do have a list of recommended developers who could help you out with the code if necessary:
If you have any other questions at all please feel free to let me know and I’d be happy to help as best I can!
Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team
The topic ‘Remove seconds from start date’ is closed to new replies.