Download & Extend

Rework Date Migrate to not use timestamps

Project:Date
Version:7.x-2.x-dev
Component:Miscellaneous
Category:task
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

By my eye, it appears that all dates are first converted to Unix timestamps:

<?php
     
// Work from a timestamp
     
$from = MigrationBase::timestamp($from);
      if (
$to) {
       
$to = MigrationBase::timestamp($to);
      }
?>

Timestamps will not work for dates prior to the Unix epoch. We should be using DateTime, and use Date module's helper functions for converting between the different formats. It'd probably be helpful to get Karen Stevenson's thoughts around this, too.

Comments

#1

Hmm, maybe I'm wrong about this. I guess strtotime returns negative numbers for times prior to the epoch? Still, Karen always advises me not to use timestamps, and when Karen says something about dates, I listen. ;)

#2

Project:Migrate Extras» Date
Version:7.x-2.x-dev» 7.x-2.x-dev
Component:Date» Miscellaneous

@q0rban: Date migration support is in the Date module itself now.

#3

Title:All dates are converted to a Unix timestamp» Rework Date Migrate to not use timestamps
Category:bug report» task

I'm going to switch this to a task. Timestamps are more limited but will work fine so long as you are not trying to migrate historical dates, so it is probably not critical to fix immediately.

nobody click here