Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

DateTime.add/4

datetime-add.livemd

DateTime.add/4

Setup

initial = DateTime.utc_now()
~U[2024-06-19 03:07:06.236071Z]

Add minutes

DateTime.add(initial, 2, :minute)
~U[2024-06-19 03:09:06.236071Z]

Add hours

DateTime.add(initial, 5, :hour)
~U[2024-06-19 08:07:06.236071Z]

Add days

DateTime.add(initial, 12, :day)
~U[2024-07-01 03:07:06.236071Z]