Date formatting

Hi Michael,

I can set the system date into a text field, however, the format is different from what I need it. It shows as YYYY-MM-DD HH:MM:SS, however, I need it to be MM/DD/YYYY HH:MM:SS.

Can you please let me know how to set this.

Thanks,

God bless!
Melvyn

You can set any format for Date widget:

image

Here is the example formatted_datetime.pma (5.1 KB)

Here is more information about the datetime format QDateTime Class | Qt Core 5.15.9

Hi Michael,

Thank you for this, just one question i took a look at the QDateTime class link you mentioned above, just want to know where exactly do I need to enter those codes.

Thanks

Hi Michael,

I have a table that has a couple of rows that have the full dates mentioned MM/DD/YYYY HH:MM:SS. I want to be able to filter this table based on only the date (MM/DD/YYYY), so that all the entries for a particular day is visible.

I was trying to use the current date solution you mentioned above, but it didnt work as that included the time as well, is it possible to use the date to filter the table. I could not find a “contain” operator in the argument section.

Thanks

The example above illustrates how to get the current date in a custom format. If you don’t need time, change the format like this: MM/dd/yyyy

image

To select rows with a given date use the Filter data custom action:

image

If you describe in detail what you are trying to do I will find a suitable example.


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.