Skip to content

Commit 0071a47

Browse files
committed
Use UTC time for syncing records and project creation timestamps
1 parent 02e0236 commit 0071a47

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

github-to-wordpress-sync.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ public function add_sync_record($project_id, $commit_sha, $commit_message, $comm
563563
'commit_sha' => $commit_sha,
564564
'commit_message' => $commit_message,
565565
'commit_date' => $commit_date,
566-
'synced_at' => current_time('mysql')
566+
'synced_at' => current_time('mysql', true)
567567
));
568568

569569
// Keep only last 20 sync records
@@ -1045,7 +1045,7 @@ public function ajax_add_project() {
10451045
'branch' => $branch,
10461046
'last_sync' => null,
10471047
'last_commit' => null,
1048-
'created_at' => current_time('mysql'),
1048+
'created_at' => current_time('mysql', true),
10491049
);
10501050

10511051
// Check for latest commit
@@ -1161,7 +1161,7 @@ public function ajax_sync_project() {
11611161
$result = $sync_manager->sync_project($project);
11621162

11631163
if ($result['success']) {
1164-
$projects[$project_index]['last_sync'] = current_time('mysql');
1164+
$projects[$project_index]['last_sync'] = current_time('mysql', true);
11651165
$projects[$project_index]['last_sync_commit'] = $project['last_commit'];
11661166
update_option('gtws_projects', $projects);
11671167

@@ -1296,7 +1296,7 @@ public function ajax_restore_commit() {
12961296
$result = $sync_manager->sync_project($project, $commit_sha);
12971297

12981298
if ($result['success']) {
1299-
$projects[$project_index]['last_sync'] = current_time('mysql');
1299+
$projects[$project_index]['last_sync'] = current_time('mysql', true);
13001300
$projects[$project_index]['last_sync_commit'] = $commit_sha;
13011301
update_option('gtws_projects', $projects);
13021302

0 commit comments

Comments
 (0)