You are here

strtotime.inc in Feeds Tamper 6

Same filename and directory in other branches
  1. 7 plugins/strtotime.inc

File

plugins/strtotime.inc
View source
<?php

/**
 * @file
 * Convert string to timestamp.
 */
$plugin = array(
  'form' => 'feeds_tamper_strtotime_form',
  'callback' => 'feeds_tamper_strtotime_callback',
  'name' => 'String to Unix timestamp',
  'multi' => 'loop',
  'category' => 'Text',
);
function feeds_tamper_strtotime_form($importer, $element_key, $settings) {
  $form = array();
  $form['html'] = array(
    '#value' => t('This will take a string containing an English date format and convert it into a Unix Timestamp.'),
  );
  return $form;
}
function feeds_tamper_strtotime_callback($source, $item_key, $element_key, &$field, $settings) {
  $field = strtotime($field);
}