diff --git a/node_gallery_api.admin.inc b/node_gallery_api.admin.inc
index b029d7e..67384f1 100644
--- a/node_gallery_api.admin.inc
+++ b/node_gallery_api.admin.inc
@@ -542,6 +542,13 @@ function node_gallery_api_settings_form($form, &$form_state) {
       ),
     ),
   );
+  $form['node_gallery_api_misc']['node_gallery_api_activate_chronological_sorting_button'] = array(
+    '#type' => 'checkbox',
+    '#weight' => 3,
+    '#title' => t('Activate the chronological order sorting feature in Sort Items tab?'),
+    '#default_value' => variable_get('node_gallery_api_activate_chronological_sorting_button', FALSE),
+    '#description' => t('When checked, you get an additional button in Sort Items tab, allowing to set shown images in chronological order, from JPEG exif embeded data.'),
+  );
 
   // TODO: Recreate wizard interface.
   // $form['#submit'] = array('node_gallery_api_settings_menu_rebuild');
diff --git a/node_gallery_api.inc b/node_gallery_api.inc
index ffc1e1e..78d9f18 100644
--- a/node_gallery_api.inc
+++ b/node_gallery_api.inc
@@ -1036,6 +1036,26 @@ function node_gallery_api_get_gallery_list($type, $uid = NULL) {
 
 
 /**
+ * Helper function to sort items
+ * @param object $oa
+ *   The left term of the sorting-comparison. Must have an original_DateTime
+ *   member.
+ * @param object $ob
+ *   Idem as $oa, being the right term.
+ *
+ * @return int
+ *   Return 0 if the original_DateTime member of each given objects are equal
+ *   -1 if oa's original_DateTime is smaller
+ *   +1 else
+ */
+function node_gallery_api_original_datetime_chronological_sort ($oa, $ob) {
+  $a = $oa->original_DateTime;
+  $b = $ob->original_DateTime;
+  if ($a == $b) return 0;
+  return $a < $b ? -1 : 1;
+}
+
+/**
  * Metadata Controller for Node Gallery Relationships
  */
 class NodeGalleryRelationshipMetadataController extends EntityDefaultMetadataController {
diff --git a/node_gallery_api.install b/node_gallery_api.install
index ec7423f..650bf68 100644
--- a/node_gallery_api.install
+++ b/node_gallery_api.install
@@ -164,6 +164,7 @@ function node_gallery_api_uninstall() {
   variable_del('node_gallery_api_keyboard_shortcuts');
   variable_del('node_gallery_api_activate_image_downloading_permission');
   variable_del('node_gallery_api_direct_image_downloading');
+  variable_del('node_gallery_api_activate_chronological_sorting_button');
   variable_del('node_gallery_api_plupload_integration');
   variable_del('node_gallery_api_plupload_manage_images_integration');
   variable_del('node_gallery_api_plupload_manage_images_limit');
diff --git a/node_gallery_api.pages.inc b/node_gallery_api.pages.inc
index 8e0c4e3..9f69777 100644
--- a/node_gallery_api.pages.inc
+++ b/node_gallery_api.pages.inc
@@ -92,10 +92,77 @@ function node_gallery_api_sort_items_form($form, $form_state, $gallery, $no_jque
     '#value' => t('Restore default sorting'),
     '#submit' => array('node_gallery_api_sort_items_form_remove_weights_submit'),
   );
+  if (variable_get('node_gallery_api_activate_chronological_sorting_button')) {
+    $form['chronological_sort'] = array(      
+      '#type' => 'submit',                    
+      '#value' => t('Set chronological order'),
+      '#submit' => array('node_gallery_api_sort_items_form_set_chronological_sorting'),
+    );
+  }
   return $form;
 }
 
 /**
+ * Submit function to set image weights reflecting chronological order of their making
+ */
+function node_gallery_api_sort_items_form_set_chronological_sorting($form, &$form_state) {
+  $images = array();
+  $ngid = $form_state['values']['ngid'];
+  $gallery = node_load ($ngid);
+  $files = node_gallery_api_get_items ($gallery, FALSE, FALSE);
+  $no_exif_count = 0;
+  $orig_datetime = '';
+  $exif = null;
+
+  // Get exif creation DateTime
+  foreach ($files as $file) {
+    $exif = exif_read_data (drupal_realpath ($file->node_gallery['item_file']['uri']));
+    if (isset ($exif)) {
+      if (isset($exif['DateTimeOriginal'])) {
+        $file->original_DateTime = new DateTime ($exif['DateTime']);
+      } /* It may be more valid exif keys here */
+    }
+    if (!isset ($file->original_DateTime)) {
+      if (user_access('access site reports')) {
+        drupal_set_message(t("Unable to find creation date in exif data for: @title", array('@title' =>$file->title)));
+      }
+      $no_exif_count++;
+      $file->original_DateTime = $file->created;
+    }
+  }
+
+  if ($no_exif_count) {
+    drupal_set_message(t("Unable to find creation date in exif data for: @count media(s)", array('@count' => $no_exif_count)));
+    if ($no_exif_count == count($files)) {
+      drupal_set_message(t("The order of the images was left unchanged."));
+      return;
+    }
+  }
+
+  usort ($files, 'node_gallery_api_original_datetime_chronological_sort');
+
+  $i = 0;
+  foreach ($files as $file) {
+    $images[] = array(
+      'nid' => $file->nid,
+      'ngid' => $ngid,
+      'weight' => $i,
+    );
+    $i++;
+  }
+  $batch = array(
+    'title' => t('Updating image order'),
+    'operations' => array(array('node_gallery_api_batch_sorting_callback', array($images))),
+    'finished' => 'node_gallery_api_batch_sorting_finished',
+    'file' => drupal_get_path('module', 'node_gallery_api') . '/node_gallery_api.inc',
+    'init_message' => t('New image positions are being calculated.'),
+    'progress_message' => t('Processing image sorting.'),
+    'error_message' => t('Image sorting has encountered an error.'),
+  );
+  batch_set($batch);
+}
+
+/**
  * Submit function to reset all image weights in a gallery to 0,
  * effectively removing any custom sort.
  */

