Skip to content

Commit

Permalink
update content
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySarnoff committed Aug 13, 2024
1 parent 0ad3238 commit 2d16645
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{
"julia.environmentPath": "c:\\github\\Time\\NanoDates.jl"
}
3 changes: 3 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
- uses DateFormat
- one 's' for each subsecond digit
- `format(::NanoDate, ::DateFormat)`
- Technical Note: DateFormats used with NanoDates must use '.' only to separate seconds from subseconds.
- If you need that sort of format, use `NanoDate(DateTime(datestring, dateformat))`.
- `nd = NanoDate(DateTime("12.31.2024 23:59", dateformat"mm.dd.yyyy HH:MM"))`


----
Expand Down
22 changes: 14 additions & 8 deletions docs/src/use/timestamps.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,20 @@
| `2022-05-24T10:43:22.350_789` | timestamp(floor(nd, Microsecond); sep=`_`) |
| `2022-05-24T10:43:22.350⬩789⬩123` | timestamp(nd; sep="⬩") |

#### timestamps that are counts offset from the UNIX Epoch (1970-01-01 UTC)
#### Offsets from the UNIX Epoch (1970-01-01 UTC)

| timestamp | resolution | method(nd::NanoDate) |
|:---------------------------------------|:------------|:------------------------------------|
| `63789100018` | second | nanodate2unixseconds(nd) |
| `63789100018123` | millisecond | nanodate2unixmillis(nd) |
| `63789100018123456` | microsecond | nanodate2unixmicros(nd) |
| NanoDate | integer offset | resolution | method(nd::NanoDate) |
|:--------------------------------|---------------------|:------------|--------------------------|
| "2022-05-24T10:43:22" | 1653389002 | second | nanodate2unixseconds(nd) |
| "2022-05-24T10:43:22.123" | 1653389002123 | millisecond | nanodate2unixmillis(nd) |
| "2022-05-24T10:43:22.123456" | 1653389002123456 | microsecond | nanodate2unixmicros(nd) |
| "2022-05-24T10:43:22.123456789" | 1653389002123456789 | nanosecond | nanodate2unixnanos(nd) |

| method(nd::NanoDate) | inverse method |
|--------------------------|-----------------------------------------|
| nanodate2unixseconds(nd) | unixseconds2nanodate(integer secs) |
| nanodate2unixmillis(nd) | unixmillis2nanodate(integer millisecs) |
| nanodate2unixmicros(nd) | unixmicros2nanodate(integer microsecs) |
| nanodate2unixnanos(nd) | unixnanos2nanodate(integer nanosecs) |

----

##### *to request another timestamp format, please raise an issue [here](https://github.com/JuliaTime/NanoDates.jl/issues)*

0 comments on commit 2d16645

Please sign in to comment.