Posted by q0rban on November 18, 2011 at 10:04pm
3 followers
Jump to:
| 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
@q0rban: Date migration support is in the Date module itself now.
#3
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.