• I write Following code to run my function every day at 16:20 ..

    But I guess is the problem in code..

    not working

    Epoch timestamp: 1427488800

    3/28/2015 1:10:00 AM

    if( !wp_next_scheduled( 'import_into_db' ) ) {
    wp_schedule_event( time('1427488800'), 'daily', 'import_into_db' );
    
    function import_into_db(){
    
    ////My code
    
    }
    add_action('wp', 'import_into_db');
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Jon (Kenshino)

    (@kenshino)

    Lord Jon

    The first parameter asks for the ‘time’ that you want the function to run for the first….. for a lack of a better word, time.

    So basically you have told your function to run the first tine in March 28 2015.

    Use time() if you want it to start nnow.

    Read http://codex.wordpress.org/Function_Reference/wp_schedule_event

    Thread Starter mortrza1371

    (@mortrza1371)

    ok.

    I want start every day at 01:28:00 AM,

    But I don’t know How add this task to wp_schedule_event..

    In Follwing web site I convert

    28 Mar 2015 13:43:24 GMT to UNIX timestamp format

    http://www.epochconverter.com/

    Now I’m stuck in this issue..

    Jon (Kenshino)

    (@kenshino)

    Lord Jon

    Why are you converting March 28? If you want it to start ALREADY and do it everyday, convert today’s date.

    Eg.

    Epoch timestamp: 1425173280
    Timestamp in milliseconds: 1425173280000
    Human time (GMT): Sun, 01 Mar 2015 01:28:00 GMT

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Wp_Schedule_Event every day at specific time’ is closed to new replies.