0

This new site is migrated from Joomla to Drupal. Most users were created 44 years ago and they should not be. I found out the created date format is different between Joomla and Drupal. So, how can I migrate or convert Joomla created date(something like this "2008-08-05 20:20:42.000000") to Drupal(something like "1335285830")?


Additional information

PS: I output Joomla Created Date as CSV.

  • 1
    How are you importing? Migrate? Feeds? – mpdonadio Jul 11 '14 at 21:32
  • Without knowing how you are doing the migration, we cannot answer you. Plus, you accepted an answer talking about using PHP code, and then asked how to do that on a CSV file. If the matter is just changing a text file, then the question is not Drupal-specific. – kiamlaluno Jul 12 '14 at 9:19
  • @MPD I'm going to use the Feeds module. – CocoSkin Jul 18 '14 at 12:41
0

Drupal uses timestamp for a date. You could convert it to timestamp using strtotime()

$timestamp = strtotime('2008-08-05 20:20:42.000000');

Now in $timestamp you will have same output as in Drupal db.

| improve this answer | |
  • Is there a way I can fix that in CSV file? – CocoSkin Jul 11 '14 at 21:02
  • Most importantly, where is the OP supposed to do this? – kiamlaluno Jul 12 '14 at 9:20
  • @kiamlaluno I can use feeds module to import these data, once I got the output. Right now, most users on this site were created 40 years ago, which should not be like that. – CocoSkin Jul 18 '14 at 12:39
  • I found the answer there stackoverflow.com/questions/1703505/… – CocoSkin Jul 30 '14 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.