danfo.Dt
Accessor object for date time properties of the Series values.
For example, in the following example, we convert a Series to an Dt instance and apply a couple of DateTime methods.
Node
1
import { Dt, Series } from "danfojs-node-nightly"
2
3
const sf = new Series(["1/1/2000", "1/2/2000", "2/3/2000", "1/4/2000", "4/5/2000"])
4
const dtS = new Dt(sf)
5
6
dtS.dayOfWeekName().print()
7
dtS.monthName().print()
Copied!
1
// output
2
╔═══╤═══════════╗
3
║ 0 │ Saturday ║
4
╟───┼───────────╢
5
║ 1 │ Sunday ║
6
╟───┼───────────╢
7
║ 2 │ Thursday ║
8
╟───┼───────────╢
9
║ 3 │ Tuesday ║
10
╟───┼───────────╢
11
║ 4 │ Wednesday ║
12
╚═══╧═══════════╝
13
14
╔═══╤══════════╗
15
║ 0 │ January ║
16
╟───┼──────────╢
17
║ 1 │ January ║
18
╟───┼──────────╢
19
║ 2 │ February ║
20
╟───┼──────────╢
21
║ 3 │ January ║
22
╟───┼──────────╢
23
║ 4 │ April ║
24
╚═══╧══════════╝
Copied!
Copy link