This is a much wider problem than Obsidian Sync. For example, if you were copy files into your Obsidian vault, the creation date for the new files will be set to the current time regardless of the creation date on the original file. Also, from what I understand, some file systems do not track a file’s creation date. So, if the creation date is an important piece of meta data for someone’s workflow, I suggest capturing it within the title of the note or the text of the note.
Personally, I think the solution is a setting or plugin that instructs Obsidian’s internal database to use metadata from the note itself instead of the file system creation date.
As a work around, I use a PowerShell script to reset the file’s creation date to match what is in my note. I run this periodically from the root of my vault.
# Get a listing of all the Markdown files within the current folder and all subfolders.
$files = Get-ChildItem "." -Recurse -Name -Filter "*.md"
foreach ($file in $files) {
# The second line of every note is in this format: "created: YYYY-MM-DD HH:mmZZ".
# So, extracting the date is done by reading the 2nd line and getting rid of the first part of the line which says "created: ".
$createdDate = Get-Content $file | Select -Index 1
$createdDate = $createdDate -replace 'created: ',''
# If the extracted text can be parsed as a valid date & time, set the creation time to the text string.
if ([string]$createdDate -as [DateTime]) {
$(Get-Item "$file").creationtime=$("$createdDate")
}
else
{
Write-Host "Error setting date for: $file"
}
}
Write-Host "Finished running. Press any key to continue..."
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")