• Resolved jamescalderon

    (@jamescalderon)


    Please help me find out how many days there are from November 22 until now.

    I have not been able to figure it out.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Denra.com

    (@denra)

    Hello @jamescalderon,

    Unfortunately the plugin does not offer this feature but we will provide a custom code later today which you may use.

    Plugin Author Denra.com

    (@denra)

    Hello @jamescalderon,

    Here is the custom code as a solution to your specific problemL

    add_shortcode( 'wpdts-ddiff', 'wpdts_ddiff' );
    function wpdts_ddiff( $atts ) {
        $mysql = current_time( 'mysql', false );
        $ts_now = strtotime( $mysql );
        $atts_filtered = shortcode_atts( array(
            'start' => date( 'Y-01-01', $ts_now ),
        ), $atts, 'wpdts-ddiff' );
        $ts_diff = $ts_now - strtotime( $atts_filtered['start'] );
        return intval( $ts_diff / DAY_IN_SECONDS);
    }

    Please place it in the functions.php file of your child theme and then just use the shortcode in the following way:

    [wpdts-ddiff start="November 11, 2023"]

    If you do not set the start attribute, the counting starts from the beginning of the current year (January 1).

    Plugin Author Denra.com

    (@denra)

    We have no feedback on this topic, so we are closing it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Subtract Dates From Start Until Now’ is closed to new replies.