Times

Forms Developer Guides Scripting Helpers

The App.Helpers.Times helpers generate and parse time objects.

App.Helpers.Times.seconds_to_time(seconds)

Returns an H:MM:SS (Hours:Minutes:Seconds) representation for a given number of seconds. If no value is given, it will default to the number of seconds since the start of the day.

The minute and second values will be 0-padded if they are below 10.

App.Helpers.Times.seconds_to_time(5025); // "1:23:45"
App.Helpers.Times.seconds_to_time(4025); // "1:07:05"

App.Helpers.Times.unix(date = new Date())

Returns the Unix Time for the given time, or the current time if no parameters are given.

App.Helpers.Times.unix(); // Current Unix Time

var time = new Date("1995-12-17T03:24:00");
App.Helpers.Times.unix(time); // 819188640