πŸ•
πŸ—„οΈ

Convert Timestamps for Database Queries

Convert dates to Unix timestamps for SQL WHERE clauses and date-range queries.

Nid oes angen mewngofnodi
Now:2026-05-27 19:55:34 UTC1779911734s Β· 1779911734960ms
Unit:
Epoch quick reference

Database tips

πŸ—„οΈ

MySQL, PostgreSQL, and SQLite store UNIX_TIMESTAMP() values as seconds since the epoch. Use "Date β†’ Timestamp" to build accurate WHERE clauses.

πŸ“Š

MongoDB stores dates as milliseconds. Use millisecond mode when filtering by ISODate in aggregation pipelines.

πŸ’‘

Avoid timezone surprises: always convert to UTC timestamp for database storage, then convert back to local time only in the display layer.

πŸ”

Copy the seconds timestamp directly into your SQL query: WHERE created_at BETWEEN 1700000000 AND 1700086400.

Sut Mae'n Gweithio

1
Ewch i mewn
Enter your data into the tool above. Everything stays local to your browser.
2
Proses
The tool processes your data instantly in your browser using JavaScript. No server, no waiting.
3
Lawrlwythwch
Get your result instantly. Nothing is stored after you leave the page β€” complete privacy.

Pam defnyddio ein un ni?

βœ“Hollol rhad ac am ddim - dim costau cudd, byth
βœ“Nid oes angen cyfrif, e-bost na mewngofnodi
βœ“Nid yw ffeiliau byth yn gadael eich dyfais
βœ“Dim cyfyngiadau maint ffeil o gwbl
βœ“Dim dyfrnodau ar unrhyw allbwn

Also check out…

Cwestiynau Cyffredin