Skip to content

jcore date

Julius Paffrath edited this page Jul 6, 2026 · 8 revisions

Introduction

The date module offers functions for date manipulation. Please note that this module does not support handling timezones. For passing and processing dates, a date struct is offered, containing fields for year, month and day.

checkIfYearIsLeapYear(year: number)

Returns true, if the passed year is a leap year.

getDateFromElapsedSeconds(elapsedSeconds: number)

Accepts unix time seconds and calculates based on these a date struct containing the corresponding day in time. The function supports negative unix time seconds for handling date before the 01.01.1970.

getElapsedSecondsFromDate(date: Date)

Accepts a date struct and calculates based on this a number of seconds since unix time. If the passed date if before unix time, the number of elapsed seconds will be negative.

stringFrom(date: Date)

A simple function for pretty printing a date struct.

print(date: Date)

Override the print function for pretty printing dates.

printLine(date: Date)

Override the printLine function for pretty printing dates with a newline.

Clone this wiki locally