Date is not correctly saved

Open
#1,214 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
sqlite, swift
Domain
databases

Research direction

No repository file or test is named. Start by reproducing the Date persistence and fetch path described with a zero-byte file and a larger file, comparing the FileManager value with the SQLite.swift value; done means the cause is identified and the reported timestamp behavior is covered by a regression test.

Written by the indexing model from the issue text.

Description

Issues are used to track bugs and feature requests.
Need help or have a general question? Ask on Stack Overflow (tag sqlite.swift).

Build Information

  • Include the SQLite.swift version, commit or branch experiencing the issue.
  • Mention Xcode and OS X versions affected.
  • How do do you integrate SQLite.swift in your project?
    • manual
    • CocoaPods
    • Carthage
    • Swift Package manager

SQLite.swift version = 0.92
Xcode version = 14.1
macOS version = 13.2.1

General guidelines

  • Be as descriptive as possible.
  • Provide as much information needed to reliably reproduce the issue.
  • Attach screenshots if possible.
  • Better yet: attach GIFs or link to video.
  • Even better: link to a sample project exhibiting the issue.

I use touch to create a new file ,zero bytes , like touch abcd.
then I read the modificationDate by using
let modifyDate = try FileManager.default.attributesOfItem(atPath: wholePath)[.modificationDate] as? Date
its description like this
`▿ 2023-06-07 02:14:52 +0000

  • timeIntervalSinceReferenceDate : 707796892.7651631`

but after I fetch it from the db.sqlite, it turns out to be:
▿ 2023-06-07 02:14:52 +0000

  • timeIntervalSinceReferenceDate : 707796892.7650001

Other files which is larger than zero bytes are fine. Just this one. I am really sure before I save it in the db, it is 707796892.7651631

Don't know why

Dominant language
Swift
Stars
10.2k
Forks
1.6k
Avg merge
6d 2h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stephencelis/SQLite.swift

All issues in stephencelis/SQLite.swift

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.