Support

Account

Home Forums Bug Reports Date Picker – date appears as 1st Jan 1970??? Reply To: Date Picker – date appears as 1st Jan 1970???

  • I am having the same problem as well.

    I’m using the following code in my theme functions file

    function datepicker_to_unix( $date ){
    	$dateparts = explode('/', $date);
    	$unixtimestamp = strtotime(date('d.m.Y', strtotime($dateparts[1].'/'.$dateparts[2].'/'.$dateparts[0])));
    	return $unixtimestamp;
    }

    And then the following in my template file

    <?php $date = get_field('field_name'); echo date('F d, Y', datepicker_to_unix($date )); ?>
    

    The result outputs: January 01, 1970