[erlang-questions] add a time interval to a timestamp

Harsh J <>
Tue Mar 15 12:22:13 CET 2011


How about handling this with seconds since year 0?
calendary:datetime_to_gregorian_seconds to get seconds, adding up this
integer in seconds as you need and converting back to datetime with

On Tue, Mar 15, 2011 at 4:24 PM, Loris Fichera <> wrote:
> Hello everybody,
> Say I want to write a function that takes as input a timestamp (in the
> form {{y,m,d}, {h,m,s}} ) and returns another timestamp, obtained by
> adding a certain amount of {hours, minutes, seconds} to the input.

Harsh J

More information about the erlang-questions mailing list