Jump to content
ahmetozay

Client created date and time

Recommended Posts

hi, i have been struggling for 2 days trying to understand, when i add a client via admin page, in tblclients table created_at column is only showing 0000-00-00 00:00:00 all zeros, also updated_at shows all zeros too, the thing is i need to query each customer's registered date as yyyy-mm-dd hh:mm:ss not just yyyy-mm-dd, please someone let me understand why created_at colum shows always zeros and where can i get client registered date and time with whmcs as 0000-00-00 00:00:00, thanks

Share this post


Link to post
Share on other sites
20 hours ago, ahmetozay said:

hi, i have been struggling for 2 days trying to understand, when i add a client via admin page, in tblclients table created_at column is only showing 0000-00-00 00:00:00 all zeros, also updated_at shows all zeros too,

WHMCS uses datecreated to store the signup date value (the date on which their account was created)... though it only stores the date, not the time.

20 hours ago, ahmetozay said:

the thing is i need to query each customer's registered date as yyyy-mm-dd hh:mm:ss not just yyyy-mm-dd, please someone let me understand why created_at column shows always zeros and where can i get client registered date and time with whmcs as 0000-00-00 00:00:00

if tblclients doesn't store the time an account is created, then you will have to try and find that information elsewhere - tblemails might be one option because when an account is created, a welcome email is usually sent (unless email template is disabled, or option unchecked during admin order) to the client... and the date AND time of that email is stored in tblemails - so that should just be a simple query to do as you know the userid of the client, and the subject of the welcome email and just take the first occurrence of it.

alternatively, you could write a ClientAdd hook that will store both date and time somewhere in the database when an account is created (either by admin or client) and you can then use that for your queries - though that wouldn't help with existing clients where the time of registration hasn't been stored.

Share this post


Link to post
Share on other sites

Thank you for detailed explanation, i suppose writing clientadd hook would be the best choice for the customers in the future.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated